summaryrefslogtreecommitdiff
path: root/include/local.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/local.h')
-rw-r--r--include/local.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/include/local.h b/include/local.h
index 9464efa4..2fe9a273 100644
--- a/include/local.h
+++ b/include/local.h
@@ -22,13 +22,30 @@
#ifndef __LOCAL_H
#define __LOCAL_H
+#include "config.h"
+
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <assert.h>
+#ifdef HAVE_ENDIAN_H
#include <endian.h>
+#elif defined(HAVE_SYS_ENDIAN_H)
+#include <sys/endian.h>
+#ifndef __BYTE_ORDER
+#define __BYTE_ORDER BYTE_ORDER
+#endif
+#ifndef __LITTLE_ENDIAN
+#define __LITTLE_ENDIAN LITTLE_ENDIAN
+#endif
+#ifndef __BIG_ENDIAN
+#define __BIG_ENDIAN BIG_ENDIAN
+#endif
+#else
+#error Header defining endianness not defined
+#endif
#include <stdarg.h>
#include <sys/poll.h>
#include <sys/types.h>
@@ -36,7 +53,6 @@
#include <linux/types.h>
#include <linux/ioctl.h>
-#include "config.h"
#ifdef SUPPORT_RESMGR
#include <resmgr.h>
#endif