ruby-changes:66054
From: Peter <ko1@a...>
Date: Wed, 5 May 2021 09:38:18 +0900 (JST)
Subject: [ruby-changes:66054] 45bcab3c84 (master): Fix compilation error in mingw
https://git.ruby-lang.org/ruby.git/commit/?id=45bcab3c84 From 45bcab3c84c406dc4d0a1e34aa858aa925a71c97 Mon Sep 17 00:00:00 2001 From: Peter Zhu <peter@p...> Date: Tue, 4 May 2021 21:31:29 +0000 Subject: Fix compilation error in mingw __LITTLE_ENDIAN is not defined. --- siphash.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/siphash.c b/siphash.c index 2c48fa8..0913767 100644 --- a/siphash.c +++ b/siphash.c @@ -5,11 +5,18 @@ https://github.com/ruby/ruby/blob/trunk/siphash.c#L5 #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 -- cgit v1.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/