summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorYukihiro Matsumoto <[email protected]>2012-06-15 14:07:24 +0900
committerYukihiro Matsumoto <[email protected]>2012-06-15 14:07:24 +0900
commit8c838de4a83956fec100e2da8dc4f49c4ace6298 (patch)
treeaa793164c3673c41e450a19afea2d84d4f2594f6
parent9e78fea7b3d2d0cb99d57913885fa48dc6843d09 (diff)
downloadmruby-8c838de4a83956fec100e2da8dc4f49c4ace6298.tar.gz
mruby-8c838de4a83956fec100e2da8dc4f49c4ace6298.zip
Time class made optinal
-rw-r--r--include/mrbconf.h3
-rw-r--r--src/init.c2
-rw-r--r--src/time.c3
3 files changed, 8 insertions, 0 deletions
diff --git a/include/mrbconf.h b/include/mrbconf.h
index 3744c1827..f4f3ccaef 100644
--- a/include/mrbconf.h
+++ b/include/mrbconf.h
@@ -39,6 +39,9 @@ typedef intptr_t mrb_sym;
#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
#endif
diff --git a/src/init.c b/src/init.c
index 1f7d4d364..13b074fd1 100644
--- a/src/init.c
+++ b/src/init.c
@@ -56,7 +56,9 @@ mrb_init_core(mrb_state *mrb)
#endif
mrb_init_exception(mrb);
mrb_init_print(mrb);
+#ifdef INCLUDE_TIME
mrb_init_time(mrb);
+#endif
#ifdef INCLUDE_MATH
mrb_init_math(mrb);
#endif
diff --git a/src/time.c b/src/time.c
index 862ff57a9..1acde8ed9 100644
--- a/src/time.c
+++ b/src/time.c
@@ -6,6 +6,7 @@
#include "mruby.h"
+#ifdef INCLUDE_TIME
#include <string.h>
#include <stdio.h>
#include <time.h>
@@ -742,3 +743,5 @@ mrb_init_time(mrb_state *mrb)
utc_offset(15.2.19.7.29)
*/
}
+#endif
+