comparison mercurial/util.h @ 16385:e501f45b0eba

util.h: unify some common platform tweaks
author Matt Mackall <mpm@selenic.com>
date Tue, 10 Apr 2012 12:07:14 -0500
parents 8d821a173e4e
children ee163a9cf37c
comparison
equal deleted inserted replaced
16384:8d821a173e4e 16385:e501f45b0eba
111 #define PY_SSIZE_T_MAX INT_MAX 111 #define PY_SSIZE_T_MAX INT_MAX
112 #define PY_SSIZE_T_MIN INT_MIN 112 #define PY_SSIZE_T_MIN INT_MIN
113 #endif 113 #endif
114 #endif 114 #endif
115 115
116 #ifdef _WIN32
117 #ifdef _MSC_VER
118 /* msvc 6.0 has problems */
119 #define inline __inline
120 typedef unsigned long uint32_t;
121 typedef unsigned __int64 uint64_t;
122 #else
123 #include <stdint.h>
124 #endif
125 static uint32_t ntohl(uint32_t x)
126 {
127 return ((x & 0x000000ffUL) << 24) |
128 ((x & 0x0000ff00UL) << 8) |
129 ((x & 0x00ff0000UL) >> 8) |
130 ((x & 0xff000000UL) >> 24);
131 }
132 #else
133 /* not windows */
134 #include <sys/types.h>
135 #if defined __BEOS__ && !defined __HAIKU__
136 #include <ByteOrder.h>
137 #else
138 #include <arpa/inet.h>
139 #endif
140 #include <inttypes.h>
141 #endif
142
143 #if defined __hpux || defined __SUNPRO_C || defined _AIX
144 #define inline
145 #endif
146
147 #ifdef __linux
148 #define inline __inline
149 #endif
150
116 #endif /* _HG_UTIL_H_ */ 151 #endif /* _HG_UTIL_H_ */