From 9959cd9522c939d83744c1eac97582c842ed9907 Mon Sep 17 00:00:00 2001 From: Michael Lutz Date: Mon, 30 Apr 2018 22:55:17 +0200 Subject: Fix 0165fe1: Native OSX doesn't have a __BYTE_ORDER macro but defines a differently named macro. --- src/core/endian_type.hpp | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'src/core') 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 +# 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 - #if __BYTE_ORDER == __LITTLE_ENDIAN - #define TTD_ENDIAN TTD_LITTLE_ENDIAN - #else - #define TTD_ENDIAN TTD_BIG_ENDIAN - #endif +# include +# 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 */ -- cgit v1.2.3-70-g09d2