From 2897e786b4753adaa124f16dcef757dfcc9bddaa Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Wed, 16 Sep 2015 18:10:47 +0000 Subject: [PATCH] Add endianness configuration block for GCC. Previously GCC using libc++ would just leak endian.h for every include. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@247827 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/__config | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/__config b/include/__config index 766750086..e951f9b11 100644 --- a/include/__config +++ b/include/__config @@ -64,6 +64,16 @@ #endif // __BIG_ENDIAN__ #endif // __BIG_ENDIAN__ +#ifdef __BYTE_ORDER__ +#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ +#define _LIBCPP_LITTLE_ENDIAN 1 +#define _LIBCPP_BIG_ENDIAN 0 +#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ +#define _LIBCPP_LITTLE_ENDIAN 0 +#define _LIBCPP_BIG_ENDIAN 1 +#endif // __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ +#endif // __BYTE_ORDER__ + #ifdef __FreeBSD__ # include # if _BYTE_ORDER == _LITTLE_ENDIAN