[compiler-rt] r220626 - builtins: avoid endian.h in favour of compiler builtins
Saleem Abdulrasool
compnerd at compnerd.org
Sat Oct 25 13:54:51 PDT 2014
Author: compnerd
Date: Sat Oct 25 15:54:51 2014
New Revision: 220626
URL: http://llvm.org/viewvc/llvm-project?rev=220626&view=rev
Log:
builtins: avoid endian.h in favour of compiler builtins
Use the __BYTE_ORDER__ macro which has been available in GCC since 4.6 and is
available in clang as well.
Modified:
compiler-rt/trunk/lib/builtins/int_endianness.h
Modified: compiler-rt/trunk/lib/builtins/int_endianness.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/builtins/int_endianness.h?rev=220626&r1=220625&r2=220626&view=diff
==============================================================================
--- compiler-rt/trunk/lib/builtins/int_endianness.h (original)
+++ compiler-rt/trunk/lib/builtins/int_endianness.h Sat Oct 25 15:54:51 2014
@@ -85,15 +85,14 @@
/* .. */
#if defined(__linux__)
-#include <endian.h>
-#if __BYTE_ORDER == __BIG_ENDIAN
+#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
#define _YUGA_LITTLE_ENDIAN 0
#define _YUGA_BIG_ENDIAN 1
-#elif __BYTE_ORDER == __LITTLE_ENDIAN
+#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
#define _YUGA_LITTLE_ENDIAN 1
#define _YUGA_BIG_ENDIAN 0
-#endif /* __BYTE_ORDER */
+#endif /* __BYTE_ORDER__ */
#endif /* GNU/Linux */
More information about the llvm-commits
mailing list