Changeset 22257 for main/trunk/greenstone2/common-src/indexers/mg/lib
- Timestamp:
- 2010-06-11T00:44:22+12:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/common-src/indexers/mg/lib/netorder.h
r16583 r22257 86 86 }while(0) 87 87 88 89 #ifdef __MINGW32__ 90 91 static inline short reverseShort(short s) 92 { 93 unsigned char c1 = s & 255; 94 unsigned char c2 = (s >> 8) & 255; 95 96 return (c1 << 8) | c2; 97 } 98 99 static inline int reverseInt (int i) 100 { 101 unsigned char c1 = i & 255; 102 unsigned char c2 = (i >> 8) & 255; 103 unsigned char c3 = (i >> 16) & 255; 104 unsigned char c4 = (i >> 24) & 255; 105 106 return ((int)c1 << 24) | ((int)c2 << 16) | ((int)c3 << 8) | c4; 107 } 108 109 #define htonl(l) reverseInt(l) 110 #define htons(s) reverseShort(s) 111 #define ntohl(l) reverseInt(l) 112 #define ntohs(s) reverseShort(s) 113 114 #endif 115 88 116 /* pointers */ 89 117 #define HTONP(p) ((p) = (void *) htonl ((unsigned long) p))
Note:
See TracChangeset
for help on using the changeset viewer.