From 1ed8d2c56f6f5e523181925526e085b5a4f93cfe Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 8 Dec 2008 11:16:37 +0100 Subject: [PATCH] include: use __BYTE_ORDER rather than AC specific WORDS_BIGENDIAN Signed-off-by: Karel Zak --- include/bitops.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/include/bitops.h b/include/bitops.h index 62deadc7..f05cbdb9 100644 --- a/include/bitops.h +++ b/include/bitops.h @@ -3,6 +3,10 @@ #include +#if !defined __BYTE_ORDER || !(__BYTE_ORDER == __LITTLE_ENDIAN) && !(__BYTE_ORDER == __BIG_ENDIAN) +#error missing __BYTE_ORDER +#endif + /* * Byte swab macros (based on linux/byteorder/swab.h) */ @@ -30,7 +34,7 @@ (uint64_t)(((uint64_t)(x) & (uint64_t)0xff00000000000000ULL) >> 56) )) -#ifdef WORDS_BIGENDIAN +#if (__BYTE_ORDER == __BIG_ENDIAN) #define cpu_to_le16(x) swab16(x) #define cpu_to_le32(x) swab32(x) @@ -46,7 +50,7 @@ #define be32_to_cpu(x) (x) #define be64_to_cpu(x) (x) -#else /* !WORDS_BIGENDIAN */ +#else /* __BYTE_ORDER != __BIG_ENDIAN */ #define cpu_to_le16(x) (x) #define cpu_to_le32(x) (x) @@ -62,7 +66,7 @@ #define be32_to_cpu(x) swab32(x) #define be64_to_cpu(x) swab64(x) -#endif /* !WORDS_BIGENDIAN */ +#endif /* __BYTE_ORDER */ #endif /* BITOPS_H */ -- 2.39.5