summaryrefslogtreecommitdiffhomepage
path: root/include/mrbconf.h
diff options
context:
space:
mode:
authordearblue <[email protected]>2018-12-22 20:37:51 +0900
committerdearblue <[email protected]>2018-12-22 20:37:51 +0900
commite9ceb865b6621739c217f68bebea023069ef63ca (patch)
tree602d893602a0330f1211264b4473104c035ce264 /include/mrbconf.h
parent281d0ff4ea3660917c015bd3728f19064931c7b2 (diff)
downloadmruby-e9ceb865b6621739c217f68bebea023069ef63ca.tar.gz
mruby-e9ceb865b6621739c217f68bebea023069ef63ca.zip
Fix MRB_ENDIAN_BIG is always defined, if byte order macro is not defined
Diffstat (limited to 'include/mrbconf.h')
-rw-r--r--include/mrbconf.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/mrbconf.h b/include/mrbconf.h
index 9bdd11af6..b1aec8334 100644
--- a/include/mrbconf.h
+++ b/include/mrbconf.h
@@ -60,7 +60,8 @@
/* define on big endian machines; used by MRB_NAN_BOXING, etc. */
#ifndef MRB_ENDIAN_BIG
-# if BYTE_ORDER == BIG_ENDIAN
+# if (defined(BYTE_ORDER) && defined(BIG_ENDIAN) && BYTE_ORDER == BIG_ENDIAN) || \
+ (defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
# define MRB_ENDIAN_BIG
# endif
#endif