Merge pull request #196 from ccawley2011/patch-2

Set MINIZ_LITTLE_ENDIAN only if not set
This commit is contained in:
Martin Raiber
2021-11-11 21:26:54 +01:00
committed by GitHub

View File

@@ -161,12 +161,15 @@
#define MINIZ_X86_OR_X64_CPU 0
#endif
/* Set MINIZ_LITTLE_ENDIAN only if not set */
#if !defined(MINIZ_LITTLE_ENDIAN)
#if (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) || MINIZ_X86_OR_X64_CPU
/* Set MINIZ_LITTLE_ENDIAN to 1 if the processor is little endian. */
#define MINIZ_LITTLE_ENDIAN 1
#else
#define MINIZ_LITTLE_ENDIAN 0
#endif
#endif
/* Using unaligned loads and stores causes errors when using UBSan */
#if defined(__has_feature)