mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
allow disabling Struct class
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user