Commit 764a791f authored by Yukihiro Matsumoto's avatar Yukihiro Matsumoto

make Math module optional

parent 91a66590
...@@ -20,21 +20,24 @@ typedef double mrb_float; ...@@ -20,21 +20,24 @@ typedef double mrb_float;
typedef int mrb_int; typedef int mrb_int;
typedef intptr_t mrb_sym; typedef intptr_t mrb_sym;
#undef PARSER_DUMP /* do not print out parser state */
//#define PARSER_DUMP /* print out parser state */ //#define PARSER_DUMP /* print out parser state */
#undef PARSER_DUMP /* do not print out parser state */
#undef INCLUDE_ENCODING /* not use encoding classes (ascii only) */
//#define INCLUDE_ENCODING /* use UTF-8 encoding classes */ //#define INCLUDE_ENCODING /* use UTF-8 encoding classes */
#undef INCLUDE_ENCODING /* not use encoding classes (ascii only) */
#undef INCLUDE_REGEXP /* not use regular expression classes */
//#define INCLUDE_REGEXP /* use regular expression classes */ //#define INCLUDE_REGEXP /* use regular expression classes */
#undef INCLUDE_REGEXP /* not use regular expression classes */
#ifdef INCLUDE_REGEXP #ifdef INCLUDE_REGEXP
# define INCLUDE_ENCODING /* Regexp depends Encoding */ # define INCLUDE_ENCODING /* Regexp depends Encoding */
#endif #endif
//#undef INCLUDE_KERNEL_SPRINTF /* not use Kernel.sprintf method. */ #define INCLUDE_KERNEL_SPRINTF /* not use Kernel.sprintf method */
#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 */
#ifdef MRUBY_DEBUG_BUILD #ifdef MRUBY_DEBUG_BUILD
# define PARSER_DUMP # define PARSER_DUMP
......
...@@ -57,7 +57,9 @@ mrb_init_core(mrb_state *mrb) ...@@ -57,7 +57,9 @@ mrb_init_core(mrb_state *mrb)
mrb_init_exception(mrb); mrb_init_exception(mrb);
mrb_init_print(mrb); mrb_init_print(mrb);
mrb_init_time(mrb); mrb_init_time(mrb);
#ifdef INCLUDE_MATH
mrb_init_math(mrb); mrb_init_math(mrb);
#endif
mrb_init_mrblib(mrb); mrb_init_mrblib(mrb);
......
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
*/ */
#include "mruby.h" #include "mruby.h"
#ifdef INCLUDE_MATH
#include <math.h> #include <math.h>
#define domain_error(msg) \ #define domain_error(msg) \
...@@ -679,3 +681,4 @@ mrb_init_math(mrb_state *mrb) ...@@ -679,3 +681,4 @@ mrb_init_math(mrb_state *mrb)
mrb_define_module_function(mrb, mrb_math, "erf", math_erf, ARGS_REQ(1)); mrb_define_module_function(mrb, mrb_math, "erf", math_erf, ARGS_REQ(1));
mrb_define_module_function(mrb, mrb_math, "erfc", math_erfc, ARGS_REQ(1)); mrb_define_module_function(mrb, mrb_math, "erfc", math_erfc, ARGS_REQ(1));
} }
#endif /* INCLUDE_MATH */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment