summaryrefslogtreecommitdiff
path: root/lib/int_endianness.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/int_endianness.h')
-rw-r--r--lib/int_endianness.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/int_endianness.h b/lib/int_endianness.h
index 70bd1773..edb58c81 100644
--- a/lib/int_endianness.h
+++ b/lib/int_endianness.h
@@ -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) */