summaryrefslogtreecommitdiffstats
path: root/include/osmocom/core/endian.h
diff options
context:
space:
mode:
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>2016-05-18 16:02:19 -0400
committerHolger Freyther <holger@freyther.de>2016-05-20 16:32:58 +0000
commitcc3694b650e22598811b3e5eaf74ef3dc0e4f7ab (patch)
treece55265c78ea37b79afdf9628d5c109425109a66 /include/osmocom/core/endian.h
parent78ad042f94afd5bf7de477ae634e9d2fdd9c9dc4 (diff)
Fix build for OSX
Change-Id: I580a500edcf4812e570be586890abef746083a8c Reviewed-on: https://gerrit.osmocom.org/74 Tested-by: Jenkins Builder Reviewed-by: Holger Freyther <holger@freyther.de>
Diffstat (limited to 'include/osmocom/core/endian.h')
-rw-r--r--include/osmocom/core/endian.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/osmocom/core/endian.h b/include/osmocom/core/endian.h
index c890fd72..02c6406d 100644
--- a/include/osmocom/core/endian.h
+++ b/include/osmocom/core/endian.h
@@ -23,6 +23,17 @@
#else
#error "Unknown endian"
#endif
+#elif defined(__APPLE__)
+#include <machine/endian.h>
+ #if defined(__DARWIN_LITTLE_ENDIAN)
+ #define OSMO_IS_LITTLE_ENDIAN 1
+ #define OSMO_IS_BIG_ENDIAN 0
+ #elif define(__DARWIN_BIG_ENDIAN)
+ #define OSMO_IS_LITTLE_ENDIAN 0
+ #define OSMO_IS_BIG_ENDIAN 1
+ #else
+ #error "Unknown endian"
+ #endif
#else
#include <endian.h>
#if __BYTE_ORDER == __LITTLE_ENDIAN