projects
/
awesomized
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
c++: fix incompatible types
[awesomized/libmemcached]
/
libmemcached
/
byteorder.cc
diff --git
a/libmemcached/byteorder.cc
b/libmemcached/byteorder.cc
index ab35a9efef70e4200e39d55098c758f17124e194..9f11aa84b3e27bcc2c5003c1d62856fb42ee8c10 100644
(file)
--- a/
libmemcached/byteorder.cc
+++ b/
libmemcached/byteorder.cc
@@
-35,7
+35,8
@@
*
*/
*
*/
-#include <libmemcached/common.h>
+#include "mem_config.h"
+#include "libmemcached/byteorder.h"
/* Byte swap a 64-bit number. */
#ifndef swap64
/* Byte swap a 64-bit number. */
#ifndef swap64
@@
-45,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;
/* 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;
{
rv= (rv << 8) | (in & 0xff);
in >>= 8;
@@
-58,12
+59,21
@@
static inline uint64_t swap64(uint64_t in)
}
#endif
}
#endif
+
uint64_t memcached_ntohll(uint64_t value)
{
uint64_t memcached_ntohll(uint64_t value)
{
+#ifdef HAVE_HTONLL
+ return ntohll(value);
+#else
return swap64(value);
return swap64(value);
+#endif
}
uint64_t memcached_htonll(uint64_t value)
{
}
uint64_t memcached_htonll(uint64_t value)
{
+#ifdef HAVE_HTONLL
+ return htonll(value);
+#else
return swap64(value);
return swap64(value);
+#endif
}
}