summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/endian_type.hpp21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/core/endian_type.hpp b/src/core/endian_type.hpp
index cb3e348b4..453bf5402 100644
--- a/src/core/endian_type.hpp
+++ b/src/core/endian_type.hpp
@@ -27,14 +27,21 @@
/* Windows has always LITTLE_ENDIAN */
#if defined(WIN32) || defined(__OS2__) || defined(WIN64)
- #define TTD_ENDIAN TTD_LITTLE_ENDIAN
+# define TTD_ENDIAN TTD_LITTLE_ENDIAN
+#elif defined(OSX)
+# include <sys/types.h>
+# if __DARWIN_BYTE_ORDER == __DARWIN_LITTLE_ENDIAN
+# define TTD_ENDIAN TTD_LITTLE_ENDIAN
+# else
+# define TTD_ENDIAN TTD_BIG_ENDIAN
+# endif
#elif !defined(TESTING)
- #include <sys/param.h>
- #if __BYTE_ORDER == __LITTLE_ENDIAN
- #define TTD_ENDIAN TTD_LITTLE_ENDIAN
- #else
- #define TTD_ENDIAN TTD_BIG_ENDIAN
- #endif
+# include <sys/param.h>
+# if __BYTE_ORDER == __LITTLE_ENDIAN
+# define TTD_ENDIAN TTD_LITTLE_ENDIAN
+# else
+# define TTD_ENDIAN TTD_BIG_ENDIAN
+# endif
#endif /* WIN32 || __OS2__ || WIN64 */
#endif /* ENDIAN_TYPE_HPP */