From: Jens Axboe Date: Wed, 5 Oct 2005 13:16:19 +0000 (+0200) Subject: [PATCH] Better endianness check X-Git-Tag: blktrace-0.99~35 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=1e3c4225dbb79342c8c341b7a726663805945e5a;p=blktrace.git [PATCH] Better endianness check --- diff --git a/blktrace.h b/blktrace.h index c1e5df1..48d0486 100644 --- a/blktrace.h +++ b/blktrace.h @@ -3,8 +3,8 @@ #include #include -#include -#include +#include + #include "blktrace_api.h" #define MINORBITS 20 @@ -44,14 +44,14 @@ extern FILE *ofp; #define CHECK_MAGIC(t) (((t)->magic & 0xffffff00) == BLK_IO_TRACE_MAGIC) #define SUPPORTED_VERSION (0x05) -#if defined(__LITTLE_ENDIAN_BITFIELD) +#if __BYTE_ORDER == __LITTLE_ENDIAN #define be16_to_cpu(x) __bswap_16(x) #define be32_to_cpu(x) __bswap_32(x) #define be64_to_cpu(x) __bswap_64(x) #define cpu_to_be16(x) __bswap_16(x) #define cpu_to_be32(x) __bswap_32(x) #define cpu_to_be64(x) __bswap_64(x) -#elif defined(__BIG_ENDIAN_BITFIELD) +#elif __BYTE_ORDER == __BIT_ENDIAN #define be16_to_cpu(x) (x) #define be32_to_cpu(x) (x) #define be64_to_cpu(x) (x)