Commit bdaa12de authored by cremno's avatar cremno

use MRB_STRINGIZE

It's defined in mruby/version.h which gets included in mruby.h, so it's
safe to use.
parent 73a012c8
...@@ -52,9 +52,6 @@ The value below allows about 60000 recursive calls in the simplest case. */ ...@@ -52,9 +52,6 @@ The value below allows about 60000 recursive calls in the simplest case. */
# define DEBUG(x) # define DEBUG(x)
#endif #endif
#define TO_STR(x) TO_STR_(x)
#define TO_STR_(x) #x
#define ARENA_RESTORE(mrb,ai) (mrb)->arena_idx = (ai) #define ARENA_RESTORE(mrb,ai) (mrb)->arena_idx = (ai)
static inline void static inline void
...@@ -160,7 +157,7 @@ stack_extend_alloc(mrb_state *mrb, int room, int keep) ...@@ -160,7 +157,7 @@ stack_extend_alloc(mrb_state *mrb, int room, int keep)
to prevent infinite recursion. However, do this only after resizing the stack, so mrb_raise has stack space to work with. */ to prevent infinite recursion. However, do this only after resizing the stack, so mrb_raise has stack space to work with. */
if (size > MRB_STACK_MAX) { if (size > MRB_STACK_MAX) {
init_new_stack_space(mrb, room, keep); init_new_stack_space(mrb, room, keep);
mrb_raise(mrb, E_SYSSTACK_ERROR, "stack level too deep. (limit=" TO_STR(MRB_STACK_MAX) ")"); mrb_raise(mrb, E_SYSSTACK_ERROR, "stack level too deep. (limit=" MRB_STRINGIZE(MRB_STACK_MAX) ")");
} }
} }
...@@ -301,7 +298,7 @@ mrb_funcall(mrb_state *mrb, mrb_value self, const char *name, mrb_int argc, ...) ...@@ -301,7 +298,7 @@ mrb_funcall(mrb_state *mrb, mrb_value self, const char *name, mrb_int argc, ...)
mrb_sym mid = mrb_intern_cstr(mrb, name); mrb_sym mid = mrb_intern_cstr(mrb, name);
if (argc > MRB_FUNCALL_ARGC_MAX) { if (argc > MRB_FUNCALL_ARGC_MAX) {
mrb_raise(mrb, E_ARGUMENT_ERROR, "Too long arguments. (limit=" TO_STR(MRB_FUNCALL_ARGC_MAX) ")"); mrb_raise(mrb, E_ARGUMENT_ERROR, "Too long arguments. (limit=" MRB_STRINGIZE(MRB_FUNCALL_ARGC_MAX) ")");
} }
va_start(ap, argc); va_start(ap, argc);
......
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