From f5537912abed308ad6967ae52bfa8699f14dae93 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Fri, 21 Dec 2018 08:49:23 +0900 Subject: Define `MRB_ENDIAN_BIG` automatically; ref #4190 You had to define this macro on big endian platforms, but it is very error-prone. So define the macro automatically if possible. --- include/mrbconf.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/mrbconf.h b/include/mrbconf.h index cc28acfaa..553ed62cc 100644 --- a/include/mrbconf.h +++ b/include/mrbconf.h @@ -58,12 +58,16 @@ # endif #endif +/* define on big endian machines; used by MRB_NAN_BOXING, etc. */ +#ifndef MRB_ENDIAN_BIG +# if defined(BYTE_ORDER) && defined(BIG_ENDIAN) && BYTE_ORDER == BIG_ENDIAN +# define MRB_ENDIAN_BIG +# endif +#endif + /* represent mrb_value in boxed double; conflict with MRB_USE_FLOAT and MRB_WITHOUT_FLOAT */ //#define MRB_NAN_BOXING -/* define on big endian machines; used by MRB_NAN_BOXING */ -//#define MRB_ENDIAN_BIG - /* represent mrb_value as a word (natural unit of data for the processor) */ //#define MRB_WORD_BOXING -- cgit v1.2.3