summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2017-08-31 14:58:54 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2017-09-01 06:51:59 +0900
commitf0f4a1088a270e339407a24ffe8be748f4764fc2 (patch)
treee8696adde8a9d9f083333cdc34d9ea47dafe8ef5 /include
parent71357ff1d8bd6ec0b3e7cce364c2513d6d3f7a77 (diff)
downloadmruby-f0f4a1088a270e339407a24ffe8be748f4764fc2.tar.gz
mruby-f0f4a1088a270e339407a24ffe8be748f4764fc2.zip
Make the default integer size to be `MRB_INT64` on 64bit systems; close #3800
Unless `MRB_NAN_BOXING` is specified.
Diffstat (limited to 'include')
-rw-r--r--include/mrbconf.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/mrbconf.h b/include/mrbconf.h
index 7559dca05..b8d603e1c 100644
--- a/include/mrbconf.h
+++ b/include/mrbconf.h
@@ -34,6 +34,17 @@
/* add -DMRB_INT64 to use 64bit integer for mrb_int; conflict with MRB_INT16 */
//#define MRB_INT64
+/* if no specific integer type is chosen */
+#if !defined(MRB_INT16) && !defined(MRB_INT32) && !defined(MRB_INT64)
+# if defined(MRB_64BIT) && !defined(MRB_NAN_BOXING)
+/* Use 64bit integers on 64bit architecture (without MRB_NAN_BOXING) */
+# define MRB_INT64
+# else
+/* Otherwise use 32bit integers */
+# define MRB_INT32
+# endif
+#endif
+
/* represent mrb_value in boxed double; conflict with MRB_USE_FLOAT */
//#define MRB_NAN_BOXING