From 445c64d0ad95ec9e4918e2f2ffedcd1df1ce96bf Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Fri, 21 Dec 2018 09:26:48 +0900 Subject: Fixed a bug on platforms without `BYTE_ORDER`; ref #4190 --- mrbgems/mruby-pack/src/pack.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mrbgems/mruby-pack/src/pack.c b/mrbgems/mruby-pack/src/pack.c index ed9f4d77f..1b1f86a88 100644 --- a/mrbgems/mruby-pack/src/pack.c +++ b/mrbgems/mruby-pack/src/pack.c @@ -71,7 +71,9 @@ static unsigned char base64_dec_tab[128]; # elif BYTE_ORDER == LITTLE_ENDIAN # define littleendian 1 # define check_little_endian() (void)0 -# else +# endif +#endif +#ifndef littleendian /* can't distinguish endian in compile time */ static int littleendian = 0; static void @@ -80,7 +82,6 @@ check_little_endian(void) unsigned int n = 1; littleendian = (*(unsigned char *)&n == 1); } -# endif #endif static unsigned int -- cgit v1.2.3