libmemcached: fix #53 with supplied patch
[awesomized/libmemcached] / libmemcached / byteorder.cc
index eb37fda82dcee74251215479fbe572fc756297b6..44500add8832a8fd33ec318a874575e21a3ae623 100644 (file)
@@ -46,7 +46,7 @@ static inline uint64_t swap64(uint64_t in)
   /* Little endian, flip the bytes around until someone makes a faster/better
    * way to do this. */
   uint64_t rv= 0;
-  for (uint8_t x= 0; x < 8; x++)
+  for (uint8_t x= 0; x < 8; ++x)
   {
     rv= (rv << 8) | (in & 0xff);
     in >>= 8;
@@ -59,6 +59,9 @@ static inline uint64_t swap64(uint64_t in)
 }
 #endif
 
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
 
 uint64_t memcached_ntohll(uint64_t value)
 {