X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/e12cb14308ab2719b506762e662ab179f31aceb9..40531be0e338556df5510f49f4472ea50713962f:/src/endian.h diff --git a/src/endian.h b/src/endian.h index ea295ee5..bef82272 100644 --- a/src/endian.h +++ b/src/endian.h @@ -5,4 +5,16 @@ void memrev16(void *p); void memrev32(void *p); void memrev64(void *p); +/* variants of the function doing the actual convertion only if the target + * host is big endian */ +#if (BYTE_ORDER == LITTLE_ENDIAN) +#define memrev16ifbe(p) +#define memrev32ifbe(p) +#define memrev64ifbe(p) +#else +#define memrev16ifbe(p) memrev16(p) +#define memrev32ifbe(p) memrev32(p) +#define memrev64ifbe(p) memrev64(p) +#endif + #endif