Add endianness configuration block for GCC.

Previously GCC using libc++ would just leak endian.h for every
include.

llvm-svn: 247827
This commit is contained in:
Dan Albert 2015-09-16 18:10:47 +00:00
parent dd07e00dbc
commit 5e61cfdb9e
1 changed files with 10 additions and 0 deletions

View File

@ -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 <sys/endian.h>
# if _BYTE_ORDER == _LITTLE_ENDIAN