diff --git a/c/common/platform.h b/c/common/platform.h index f66a6cb..dbba942 100644 --- a/c/common/platform.h +++ b/c/common/platform.h @@ -29,17 +29,7 @@ #include #include -#if defined(OS_LINUX) || defined(OS_CYGWIN) || defined(__EMSCRIPTEN__) -#include -#elif defined(OS_FREEBSD) -#include -#elif defined(OS_MACOSX) -#include -/* Let's try and follow the Linux convention */ -#define BROTLI_X_BYTE_ORDER BYTE_ORDER -#define BROTLI_X_LITTLE_ENDIAN LITTLE_ENDIAN -#define BROTLI_X_BIG_ENDIAN BIG_ENDIAN -#endif +#include /* should include endian.h for us */ #if BROTLI_MSVC_VERSION_CHECK(18, 0, 0) #include @@ -248,13 +238,12 @@ OR: #define BROTLI_LITTLE_ENDIAN 1 #elif defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) #define BROTLI_BIG_ENDIAN 1 -#elif defined(BROTLI_X_BYTE_ORDER) -#if BROTLI_X_BYTE_ORDER == BROTLI_X_LITTLE_ENDIAN +/* Likely target platform is iOS / OSX. */ +#elif defined(BYTE_ORDER) && (BYTE_ORDER == LITTLE_ENDIAN) #define BROTLI_LITTLE_ENDIAN 1 -#elif BROTLI_X_BYTE_ORDER == BROTLI_X_BIG_ENDIAN +#elif defined(BYTE_ORDER) && (BYTE_ORDER == BIG_ENDIAN) #define BROTLI_BIG_ENDIAN 1 #endif -#endif /* BROTLI_X_BYTE_ORDER */ #if !defined(BROTLI_LITTLE_ENDIAN) #define BROTLI_LITTLE_ENDIAN 0 @@ -264,12 +253,6 @@ OR: #define BROTLI_BIG_ENDIAN 0 #endif -#if defined(BROTLI_X_BYTE_ORDER) -#undef BROTLI_X_BYTE_ORDER -#undef BROTLI_X_LITTLE_ENDIAN -#undef BROTLI_X_BIG_ENDIAN -#endif - #if defined(BROTLI_BUILD_NO_UNALIGNED_READ_FAST) #define BROTLI_UNALIGNED_READ_FAST (!!0) #elif defined(BROTLI_TARGET_X86) || defined(BROTLI_TARGET_X64) || \