X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fstdendian.h;h=2fc569ce4d44581f9c3429b8e998974c68d1d929;hb=ffba5b8b514103329bd82f8d773194fb7744f55a;hp=4d32b156c3c7789cae2ad133d0cab6d78cf17cbb;hpb=506fbd9f7cc988eb9e0999c4779ff77c286e970f;p=collectd.git diff --git a/src/stdendian.h b/src/stdendian.h index 4d32b156..2fc569ce 100644 --- a/src/stdendian.h +++ b/src/stdendian.h @@ -173,7 +173,7 @@ /* handle missing __builtin_bswap16 * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52624 */ #if defined __GNUC__ -/* define bswap16(x) __builtin_bswap16(x) */ +#define bswap16(x) __builtin_bswap16(x) #else #define bswap16(x) \ ((uint16_t)((((uint16_t)(x)&0xff00) >> 8) | (((uint16_t)(x)&0x00ff) << 8))) @@ -211,7 +211,7 @@ /* Host swap macros */ #ifndef __HOSTSWAP_DEFINED -#if __BYTE_ORDER == __LITTLE_ENDIAN +#if _BYTE_ORDER == _LITTLE_ENDIAN #define htobe16(x) bswap16((x)) #define htole16(x) ((uint16_t)(x)) #define be16toh(x) bswap16((x)) @@ -226,7 +226,7 @@ #define htole64(x) ((uint64_t)(x)) #define be64toh(x) bswap64((x)) #define le64toh(x) ((uint64_t)(x)) -#elif __BYTE_ORDER == __BIG_ENDIAN +#elif _BYTE_ORDER == _BIG_ENDIAN #define htobe16(x) ((uint16_t)(x)) #define htole16(x) bswap16((x)) #define be16toh(x) ((uint16_t)(x))