diff options
| author | Yukihiro Matsumoto <[email protected]> | 2012-06-17 23:36:34 +0900 |
|---|---|---|
| committer | Yukihiro Matsumoto <[email protected]> | 2012-06-17 23:36:34 +0900 |
| commit | ede3049f33f8c6cdb703784619fb4143bfe3b441 (patch) | |
| tree | 6603c359fab9b0d3090ee45ef77c75eea6973604 | |
| parent | 8399d936a233429d748888ca17a27f53a1ae3e48 (diff) | |
| download | mruby-ede3049f33f8c6cdb703784619fb4143bfe3b441.tar.gz mruby-ede3049f33f8c6cdb703784619fb4143bfe3b441.zip | |
allow disabling Struct class
| -rw-r--r-- | include/mrbconf.h | 4 | ||||
| -rw-r--r-- | src/init.c | 2 | ||||
| -rw-r--r-- | src/struct.c | 2 |
3 files changed, 8 insertions, 0 deletions
diff --git a/include/mrbconf.h b/include/mrbconf.h index 4b778e6de..21b8fea18 100644 --- a/include/mrbconf.h +++ b/include/mrbconf.h @@ -18,6 +18,7 @@ #undef DISABLE_KERNEL_SPRINTF /* Kernel.sprintf method */ #undef DISABLE_MATH /* Math functions */ #undef DISABLE_TIME /* Time class */ +#undef DISABLE_STRUCT /* Struct class */ #undef HAVE_UNISTD_H /* WINDOWS */ #define HAVE_UNISTD_H /* LINUX */ @@ -46,6 +47,9 @@ typedef intptr_t mrb_sym; #ifndef DISABLE_TIME #define ENABLE_TIME #endif +#ifndef DISABLE_STRUCT +#define ENABLE_STRUCT +#endif #ifndef FALSE # define FALSE 0 diff --git a/src/init.c b/src/init.c index a515ee880..e2ab62339 100644 --- a/src/init.c +++ b/src/init.c @@ -49,7 +49,9 @@ mrb_init_core(mrb_state *mrb) mrb_init_hash(mrb); mrb_init_numeric(mrb); mrb_init_range(mrb); +#ifdef ENABLE_STRUCT mrb_init_struct(mrb); +#endif mrb_init_gc(mrb); #ifdef ENABLE_REGEXP mrb_init_regexp(mrb); diff --git a/src/struct.c b/src/struct.c index 8e9804cbc..c0af85d0e 100644 --- a/src/struct.c +++ b/src/struct.c @@ -5,6 +5,7 @@ */ #include "mruby.h" +#ifdef ENABLE_STRUCT #include <string.h> #include "error.h" #include "mruby/struct.h" @@ -793,3 +794,4 @@ mrb_init_struct(mrb_state *mrb) mrb_define_method(mrb, st, "eql?", mrb_struct_eql, ARGS_REQ(1)); /* 15.2.18.4.12(x) */ } +#endif /* ENABLE_STRUCT */ |
