[libcxx] r247827 - Add endianness configuration block for GCC.
Dan Albert via cfe-commits
cfe-commits at lists.llvm.org
Wed Sep 16 11:10:47 PDT 2015
Author: danalbert
Date: Wed Sep 16 13:10:47 2015
New Revision: 247827
URL: http://llvm.org/viewvc/llvm-project?rev=247827&view=rev
Log:
Add endianness configuration block for GCC.
Previously GCC using libc++ would just leak endian.h for every
include.
Modified:
libcxx/trunk/include/__config
Modified: libcxx/trunk/include/__config
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__config?rev=247827&r1=247826&r2=247827&view=diff
==============================================================================
--- libcxx/trunk/include/__config (original)
+++ libcxx/trunk/include/__config Wed Sep 16 13:10:47 2015
@@ -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
More information about the cfe-commits
mailing list