Commit da257afe authored by antirez's avatar antirez
Browse files

htonu64() and ntohu64 added to endianconv.h.

parent 3c9bb875
...@@ -61,4 +61,14 @@ uint64_t intrev64(uint64_t v); ...@@ -61,4 +61,14 @@ uint64_t intrev64(uint64_t v);
#define intrev64ifbe(v) intrev64(v) #define intrev64ifbe(v) intrev64(v)
#endif #endif
/* The functions htonu64() and ntohu64() convert the specified value to
* network byte ordering and back. In big endian systems they are no-ops. */
#if (BYTE_ORDER == BIG_ENDIAN)
#define htonu64(v) (v)
#define ntohu64(v) (v)
#else
#define htonu64(v) intrev64(v)
#define ntohu64(v) intrev64(v)
#endif
#endif #endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment