X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libmemcached%2Fbyteorder.c;h=96a39bf88ff7d8fc166182b56c197ede274b24af;hb=a8efa12d2d90c3777f3c33347fe002884be1185d;hp=4b6eeb07acbeafaf2ea54107f15e824dcf47ed73;hpb=55b5455291498ef63c1c34976552d58708a74732;p=awesomized%2Flibmemcached diff --git a/libmemcached/byteorder.c b/libmemcached/byteorder.c index 4b6eeb07..96a39bf8 100644 --- a/libmemcached/byteorder.c +++ b/libmemcached/byteorder.c @@ -12,14 +12,14 @@ #include "byteorder.h" /* Byte swap a 64-bit number. */ +#ifndef swap64 static inline uint64_t swap64(uint64_t in) { #ifndef WORDS_BIGENDIAN /* Little endian, flip the bytes around until someone makes a faster/better * way to do this. */ uint64_t rv= 0; - uint8_t x= 0; - for(x= 0; x < 8; x++) + for (uint8_t x= 0; x < 8; x++) { rv= (rv << 8) | (in & 0xff); in >>= 8; @@ -28,8 +28,9 @@ static inline uint64_t swap64(uint64_t in) #else /* big-endian machines don't need byte swapping */ return in; -#endif +#endif // WORDS_BIGENDIAN } +#endif uint64_t ntohll(uint64_t value) {