summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorYukihiro Matsumoto <[email protected]>2012-06-15 15:34:49 +0900
committerYukihiro Matsumoto <[email protected]>2012-06-15 15:34:49 +0900
commit76f7aecff326666543d9bac31fe13e0cab8e05f4 (patch)
treee9bf296dc74535f334852e9cb5763005e2747ddb /include
parent4aa9111f9a107b3b0c6f1c13d933cbcd39f2a787 (diff)
downloadmruby-76f7aecff326666543d9bac31fe13e0cab8e05f4.tar.gz
mruby-76f7aecff326666543d9bac31fe13e0cab8e05f4.zip
use ENABLE/DISABLE instead of INCLUDE for configuration macro names
Diffstat (limited to 'include')
-rw-r--r--include/mrbconf.h50
-rw-r--r--include/mruby/class.h9
2 files changed, 25 insertions, 34 deletions
diff --git a/include/mrbconf.h b/include/mrbconf.h
index f4f3ccaef..4b778e6de 100644
--- a/include/mrbconf.h
+++ b/include/mrbconf.h
@@ -8,8 +8,21 @@
#define MRUBYCONF_H
#include <stdint.h>
+
+/* configuration options: */
+/* add -DMRB_USE_FLOAT to use float instead of double for floating point numbers */
#undef MRB_USE_FLOAT
+/* -DDISABLE_XXXX to change to drop the feature */
+#define DISABLE_REGEXP /* regular expression classes */
+#undef DISABLE_KERNEL_SPRINTF /* Kernel.sprintf method */
+#undef DISABLE_MATH /* Math functions */
+#undef DISABLE_TIME /* Time class */
+
+#undef HAVE_UNISTD_H /* WINDOWS */
+#define HAVE_UNISTD_H /* LINUX */
+/* end of configuration */
+
#ifdef MRB_USE_FLOAT
typedef float mrb_float;
#else
@@ -20,34 +33,19 @@ typedef double mrb_float;
typedef int mrb_int;
typedef intptr_t mrb_sym;
-//#define PARSER_DUMP /* print out parser state */
-#undef PARSER_DUMP /* do not print out parser state */
-
-//#define INCLUDE_ENCODING /* use UTF-8 encoding classes */
-#undef INCLUDE_ENCODING /* not use encoding classes (ascii only) */
-
-//#define INCLUDE_REGEXP /* use regular expression classes */
-#undef INCLUDE_REGEXP /* not use regular expression classes */
-
-#ifdef INCLUDE_REGEXP
-# define INCLUDE_ENCODING /* Regexp depends Encoding */
+/* define ENABLE_XXXX from DISABLE_XXX */
+#ifndef DISABLE_REGEXP
+#define ENABLE_REGEXP
#endif
-
-#define INCLUDE_KERNEL_SPRINTF /* not use Kernel.sprintf method */
-//#undef INCLUDE_KERNEL_SPRINTF /* not use Kernel.sprintf method */
-
-#define INCLUDE_MATH /* use (non ISO) Math module */
-//#undef INCLUDE_MATH /* not use (non ISO) Math module */
-
-#define INCLUDE_TIME /* use Time module */
-//#undef INCLUDE_TIME /* not use Time module */
-
-#ifdef MRUBY_DEBUG_BUILD
-# define PARSER_DUMP
+#ifndef DISABLE_KERNEL_SPRINTF
+#define ENABLE_KERNEL_SPRINTF
+#endif
+#ifndef DISABLE_MATH
+#define ENABLE_MATH
+#endif
+#ifndef DISABLE_TIME
+#define ENABLE_TIME
#endif
-
-#undef HAVE_UNISTD_H /* WINDOWS */
-#define HAVE_UNISTD_H /* LINUX */
#ifndef FALSE
# define FALSE 0
diff --git a/include/mruby/class.h b/include/mruby/class.h
index 35dd0ec1d..2cc90310e 100644
--- a/include/mruby/class.h
+++ b/include/mruby/class.h
@@ -40,14 +40,7 @@ mrb_class(mrb_state *mrb, mrb_value v)
case MRB_TT_FLOAT:
return mrb->float_class;
-#ifdef INCLUDE_REGEXP
-// case MRB_TT_REGEX:
-// return mrb->regex_class;
-// case MRB_TT_MATCH:
-// return mrb->match_class;
-// case MRB_TT_DATA:
-// return mrb->encode_class;
-#else
+#ifdef ENABLE_REGEXP
case MRB_TT_REGEX:
case MRB_TT_MATCH:
mrb_raise(mrb, E_TYPE_ERROR, "type mismatch: %s given",