summaryrefslogtreecommitdiffhomepage
path: root/include/mrbconf.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/mrbconf.h')
-rw-r--r--include/mrbconf.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/mrbconf.h b/include/mrbconf.h
index ab5dd1a03..4796919c2 100644
--- a/include/mrbconf.h
+++ b/include/mrbconf.h
@@ -7,6 +7,23 @@
#ifndef MRUBYCONF_H
#define MRUBYCONF_H
+#include <limits.h>
+#include <stdint.h>
+
+/* architecture selection: */
+/* specify -DMRB_32BIT or -DMRB_64BIT to override */
+#if !defined(MRB_32BIT) && !defined(MRB_64BIT)
+#if UINT64_MAX == SIZE_MAX
+#define MRB_64BIT
+#else
+#define MRB_32BIT
+#endif
+#endif
+
+#if defined(MRB_32BIT) && defined(MRB_64BIT)
+#error Cannot build for 32 and 64 bit architecture at the same time
+#endif
+
/* configuration options: */
/* add -DMRB_USE_FLOAT to use float instead of double for floating point numbers */
//#define MRB_USE_FLOAT