summaryrefslogtreecommitdiffstats
path: root/include/osdep.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/osdep.h')
-rw-r--r--include/osdep.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/osdep.h b/include/osdep.h
index 8e790595..84bd04fc 100644
--- a/include/osdep.h
+++ b/include/osdep.h
@@ -14,6 +14,12 @@
#define _XOPEN_SOURCE
#define _ISOC99_SOURCE
+
+ #if BYTE_ORDER == BIG_ENDIAN
+ #define _BIG_ENDIAN
+ #else
+ #define _LITTLE_ENDIAN
+ #endif
#elif defined(__linux__)
@@ -22,6 +28,13 @@
#include <sys/ioctl.h>
#include <sys/file.h> /* for flock() */
#include <strings.h> /* for strcasecmp() */
+ #include <endian.h> /* for __BYTE_ORDER */
+
+ #if __BYTE_ORDER == __BIG_ENDIAN
+ #define _BIG_ENDIAN
+ #else
+ #define _LITTLE_ENDIAN
+ #endif
#define NEED_STRCASESTR
#define NEED_STRLCPY