summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-compiler
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2015-11-17 05:21:14 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2015-11-17 07:30:34 +0900
commit4440566b9522ae5ff6b2bce7b3d8ecd232304eea (patch)
tree5e700a8669d559239d1e1d044a4b32f7723de7d4 /mrbgems/mruby-compiler
parent1dfe38bea0bd1e4c82149aa9fea90dd4e796af38 (diff)
downloadmruby-4440566b9522ae5ff6b2bce7b3d8ecd232304eea.tar.gz
mruby-4440566b9522ae5ff6b2bce7b3d8ecd232304eea.zip
DISABLE_STDIO/ENABLE_DEBUG macros to rename; close #3014
changes: * rename DISABLE_STDIO -> MRB_DISABLE_STDIO * rename ENABLE_DEBUG -> MRB_ENABLE_DEBUG_HOOK * no more opposite macro definitions (e.g. ENABLE_STDIO, DISABLE_DEBUG). * rewrite above macro references throughout the code. * update documents
Diffstat (limited to 'mrbgems/mruby-compiler')
-rw-r--r--mrbgems/mruby-compiler/core/codegen.c6
-rw-r--r--mrbgems/mruby-compiler/core/parse.y18
2 files changed, 12 insertions, 12 deletions
diff --git a/mrbgems/mruby-compiler/core/codegen.c b/mrbgems/mruby-compiler/core/codegen.c
index d9a8e463e..b47c1c623 100644
--- a/mrbgems/mruby-compiler/core/codegen.c
+++ b/mrbgems/mruby-compiler/core/codegen.c
@@ -96,7 +96,7 @@ codegen_error(codegen_scope *s, const char *message)
mrb_pool_close(s->mpool);
s = tmp;
}
-#ifdef ENABLE_STDIO
+#ifndef MBB_DISABLE_STDIO
if (s->filename && s->lineno) {
fprintf(stderr, "codegen error:%s:%d: %s\n", s->filename, s->lineno, message);
}
@@ -375,7 +375,7 @@ dispatch(codegen_scope *s, int pc)
case OP_ONERR:
break;
default:
-#ifdef ENABLE_STDIO
+#ifndef MRB_DISABLE_STDIO
fprintf(stderr, "bug: dispatch on non JMP op\n");
#endif
scope_error(s);
@@ -978,7 +978,7 @@ gen_assignment(codegen_scope *s, node *tree, int sp, int val)
break;
default:
-#ifdef ENABLE_STDIO
+#ifndef MRB_DISABLE_STDIO
printf("unknown lhs %d\n", type);
#endif
break;
diff --git a/mrbgems/mruby-compiler/core/parse.y b/mrbgems/mruby-compiler/core/parse.y
index 4cd385d65..032e9e16b 100644
--- a/mrbgems/mruby-compiler/core/parse.y
+++ b/mrbgems/mruby-compiler/core/parse.y
@@ -3294,7 +3294,7 @@ yyerror(parser_state *p, const char *s)
int n;
if (! p->capture_errors) {
-#ifdef ENABLE_STDIO
+#ifndef MRB_DISABLE_STDIO
if (p->filename) {
fprintf(stderr, "%s:%d:%d: %s\n", p->filename, p->lineno, p->column, s);
}
@@ -3330,7 +3330,7 @@ yywarn(parser_state *p, const char *s)
int n;
if (! p->capture_errors) {
-#ifdef ENABLE_STDIO
+#ifndef MRB_DISABLE_STDIO
if (p->filename) {
fprintf(stderr, "%s:%d:%d: %s\n", p->filename, p->lineno, p->column, s);
}
@@ -3401,7 +3401,7 @@ nextc(parser_state *p)
cons_free(tmp);
}
else {
-#ifdef ENABLE_STDIO
+#ifndef MRB_DISABLE_STDIO
if (p->f) {
if (feof(p->f)) goto eof;
c = fgetc(p->f);
@@ -3491,7 +3491,7 @@ peeks(parser_state *p, const char *s)
{
int len = strlen(s);
-#ifdef ENABLE_STDIO
+#ifndef MRB_DISABLE_STDIO
if (p->f) {
int n = 0;
while (*s) {
@@ -5442,7 +5442,7 @@ mrb_parser_new(mrb_state *mrb)
p->pool = pool;
p->s = p->send = NULL;
-#ifdef ENABLE_STDIO
+#ifndef MRB_DISBLE_STDIO
p->f = NULL;
#endif
@@ -5541,7 +5541,7 @@ mrb_parser_get_filename(struct mrb_parser_state* p, uint16_t idx) {
}
}
-#ifdef ENABLE_STDIO
+#ifndef MRB_DISABLE_STDIO
MRB_API parser_state*
mrb_parse_file(mrb_state *mrb, FILE *f, mrbc_context *c)
{
@@ -5633,7 +5633,7 @@ load_exec(mrb_state *mrb, parser_state *p, mrbc_context *c)
return v;
}
-#ifdef ENABLE_STDIO
+#ifndef MRB_DISABLE_STDIO
MRB_API mrb_value
mrb_load_file_cxt(mrb_state *mrb, FILE *f, mrbc_context *c)
{
@@ -5671,7 +5671,7 @@ mrb_load_string(mrb_state *mrb, const char *s)
return mrb_load_string_cxt(mrb, s, NULL);
}
-#ifdef ENABLE_STDIO
+#ifndef MRB_DISABLE_STDIO
static void
dump_prefix(node *tree, int offset)
@@ -5697,7 +5697,7 @@ dump_recur(mrb_state *mrb, node *tree, int offset)
void
mrb_parser_dump(mrb_state *mrb, node *tree, int offset)
{
-#ifdef ENABLE_STDIO
+#ifndef MRB_DISABLE_STDIO
int nodetype;
if (!tree) return;