[llvm-commits] [compiler-rt] r164286 - in /compiler-rt/trunk: lib/int_endianness.h test/Unit/endianness.h
Eric Christopher
echristo at apple.com
Wed Sep 19 23:19:20 PDT 2012
Author: echristo
Date: Thu Sep 20 01:19:20 2012
New Revision: 164286
URL: http://llvm.org/viewvc/llvm-project?rev=164286&view=rev
Log:
Both OpenBSD and Bitrig need to include machine/endian.h to get the
_BYTE_ORDER define.
Patch by David Hill.
Modified:
compiler-rt/trunk/lib/int_endianness.h
compiler-rt/trunk/test/Unit/endianness.h
Modified: compiler-rt/trunk/lib/int_endianness.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/int_endianness.h?rev=164286&r1=164285&r2=164286&view=diff
==============================================================================
--- compiler-rt/trunk/lib/int_endianness.h (original)
+++ compiler-rt/trunk/lib/int_endianness.h Thu Sep 20 01:19:20 2012
@@ -31,7 +31,7 @@
/* .. */
-#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__minix)
+#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__) || defined(__minix)
#include <sys/endian.h>
#if _BYTE_ORDER == _BIG_ENDIAN
@@ -44,6 +44,19 @@
#endif /* *BSD */
+#if defined(__OpenBSD__) || defined(__Bitrig__)
+#include <machine/endian.h>
+
+#if _BYTE_ORDER == _BIG_ENDIAN
+#define _YUGA_LITTLE_ENDIAN 0
+#define _YUGA_BIG_ENDIAN 1
+#elif _BYTE_ORDER == _LITTLE_ENDIAN
+#define _YUGA_LITTLE_ENDIAN 1
+#define _YUGA_BIG_ENDIAN 0
+#endif /* _BYTE_ORDER */
+
+#endif /* OpenBSD and Bitrig. */
+
/* .. */
/* Mac OSX has __BIG_ENDIAN__ or __LITTLE_ENDIAN__ automatically set by the compiler (at least with GCC) */
Modified: compiler-rt/trunk/test/Unit/endianness.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/Unit/endianness.h?rev=164286&r1=164285&r2=164286&view=diff
==============================================================================
--- compiler-rt/trunk/test/Unit/endianness.h (original)
+++ compiler-rt/trunk/test/Unit/endianness.h Thu Sep 20 01:19:20 2012
@@ -51,6 +51,21 @@
/* .. */
+#if defined(__OpenBSD__) || defined(__Bitrig__)
+#include <machine/endian.h>
+
+#if _BYTE_ORDER == _BIG_ENDIAN
+#define _YUGA_LITTLE_ENDIAN 0
+#define _YUGA_BIG_ENDIAN 1
+#elif _BYTE_ORDER == _LITTLE_ENDIAN
+#define _YUGA_LITTLE_ENDIAN 1
+#define _YUGA_BIG_ENDIAN 0
+#endif /* _BYTE_ORDER */
+
+#endif /* OpenBSD and Bitrig. */
+
+/* .. */
+
/* Mac OSX has __BIG_ENDIAN__ or __LITTLE_ENDIAN__ automatically set by the compiler (at least with GCC) */
#if defined(__APPLE__) && defined(__MACH__) || defined(__ellcc__ )
More information about the llvm-commits
mailing list