diff options
author | Peter Zhu <[email protected]> | 2021-05-04 21:31:29 +0000 |
---|---|---|
committer | Peter Zhu <[email protected]> | 2021-05-04 20:38:03 -0400 |
commit | 45bcab3c84c406dc4d0a1e34aa858aa925a71c97 (patch) | |
tree | c2e754dfb8aa9c0d083fde10cd5dd0c827d4dc61 /siphash.c | |
parent | b57c7be6a98a4739569f5ddc45095c8c59fa7512 (diff) |
Fix compilation error in mingw
__LITTLE_ENDIAN is not defined.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/4457
Diffstat (limited to 'siphash.c')
-rw-r--r-- | siphash.c | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -5,11 +5,18 @@ #define SIP_HASH_STREAMING 1 #endif -#ifdef _WIN32 +#if defined(__MINGW32__) + #include <sys/param.h> + + /* MinGW only defines LITTLE_ENDIAN and BIG_ENDIAN macros */ + #define __LITTLE_ENDIAN LITTLE_ENDIAN + #define __BIG_ENDIAN BIG_ENDIAN +#elif defined(_WIN32) #define BYTE_ORDER __LITTLE_ENDIAN -#elif !defined BYTE_ORDER +#elif !defined(BYTE_ORDER) #include <endian.h> #endif + #ifndef LITTLE_ENDIAN #define LITTLE_ENDIAN __LITTLE_ENDIAN #endif |