##// END OF EJS Templates
util.h: backout 06badf7d10dc and 2c9645c0a582 for big-endian breakage...
Siddharth Agarwal -
r19833:1935e838 default
parent child Browse files
Show More
@@ -151,17 +151,6 b' typedef unsigned __int64 uint64_t;'
151 #define inline __inline
151 #define inline __inline
152 #endif
152 #endif
153
153
154 #if defined(_MSC_VER) && (_MSC_VER >= 1300)
155 static inline uint32_t getbe32(const char *c)
156 {
157 return _byteswap_ulong(*(uint32_t *)c);
158 }
159 #elif __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
160 static inline uint32_t getbe32(const char *c)
161 {
162 return __builtin_bswap32(*(uint32_t *)c);
163 }
164 #else
165 static inline uint32_t getbe32(const char *c)
154 static inline uint32_t getbe32(const char *c)
166 {
155 {
167 const unsigned char *d = (const unsigned char *)c;
156 const unsigned char *d = (const unsigned char *)c;
@@ -171,21 +160,7 b' static inline uint32_t getbe32(const cha'
171 (d[2] << 8) |
160 (d[2] << 8) |
172 (d[3]));
161 (d[3]));
173 }
162 }
174 #endif
175
163
176 #if defined(_MSC_VER) && (_MSC_VER >= 1300)
177 static inline void putbe32(uint32_t x, char *c)
178 {
179 x = _byteswap_ulong(x);
180 *(uint32_t *)c = x;
181 }
182 #elif __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
183 static inline void putbe32(uint32_t x, char *c)
184 {
185 x = __builtin_bswap32(x);
186 *(uint32_t *)c = x;
187 }
188 #else
189 static inline void putbe32(uint32_t x, char *c)
164 static inline void putbe32(uint32_t x, char *c)
190 {
165 {
191 c[0] = (x >> 24) & 0xff;
166 c[0] = (x >> 24) & 0xff;
@@ -193,6 +168,5 b' static inline void putbe32(uint32_t x, c'
193 c[2] = (x >> 8) & 0xff;
168 c[2] = (x >> 8) & 0xff;
194 c[3] = (x) & 0xff;
169 c[3] = (x) & 0xff;
195 }
170 }
196 #endif
197
171
198 #endif /* _HG_UTIL_H_ */
172 #endif /* _HG_UTIL_H_ */
General Comments 0
You need to be logged in to leave comments. Login now