mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
DIABLE_STDIO to disable __printstr__
This commit is contained in:
+3
-1
@@ -43,6 +43,7 @@ mrb_init_core(mrb_state *mrb)
|
||||
mrb_init_enumerable(mrb);
|
||||
|
||||
mrb_init_symbol(mrb);
|
||||
mrb_init_exception(mrb);
|
||||
mrb_init_proc(mrb);
|
||||
mrb_init_string(mrb);
|
||||
mrb_init_array(mrb);
|
||||
@@ -56,8 +57,9 @@ mrb_init_core(mrb_state *mrb)
|
||||
#ifdef ENABLE_REGEXP
|
||||
mrb_init_regexp(mrb);
|
||||
#endif
|
||||
mrb_init_exception(mrb);
|
||||
#ifdef ENABLE_STDIO
|
||||
mrb_init_print(mrb);
|
||||
#endif
|
||||
#ifdef ENABLE_TIME
|
||||
mrb_init_time(mrb);
|
||||
#endif
|
||||
|
||||
+13
-2
@@ -5,10 +5,11 @@
|
||||
*/
|
||||
|
||||
#include "mruby.h"
|
||||
#ifdef ENABLE_STDIO
|
||||
#include "mruby/string.h"
|
||||
#include <stdio.h>
|
||||
|
||||
mrb_value
|
||||
static void
|
||||
printstr(mrb_state *mrb, mrb_value obj)
|
||||
{
|
||||
struct RString *str;
|
||||
@@ -24,7 +25,6 @@ printstr(mrb_state *mrb, mrb_value obj)
|
||||
s++;
|
||||
}
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
mrb_value
|
||||
@@ -71,3 +71,14 @@ mrb_show_copyright(mrb_state *mrb)
|
||||
{
|
||||
printf("mruby - Copyright (c) 2010-2012 mruby developers\n");
|
||||
}
|
||||
#else
|
||||
void
|
||||
mrb_show_version(mrb_state *mrb)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
mrb_show_copyright(mrb_state *mrb)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user