mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
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
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
#include "value_array.h"
|
||||
#include "mruby/throw.h"
|
||||
|
||||
#ifndef ENABLE_STDIO
|
||||
#ifndef MRB_DISABLE_STDIO
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
@@ -693,7 +693,7 @@ argnum_error(mrb_state *mrb, mrb_int num)
|
||||
|
||||
#define ERR_PC_SET(mrb, pc) mrb->c->ci->err = pc;
|
||||
#define ERR_PC_CLR(mrb) mrb->c->ci->err = 0;
|
||||
#ifdef ENABLE_DEBUG
|
||||
#ifdef MRB_ENABLE_DEBUG_HOOK
|
||||
#define CODE_FETCH_HOOK(mrb, irep, pc, regs) if ((mrb)->code_fetch_hook) (mrb)->code_fetch_hook((mrb), (irep), (pc), (regs));
|
||||
#else
|
||||
#define CODE_FETCH_HOOK(mrb, irep, pc, regs)
|
||||
@@ -2340,10 +2340,10 @@ RETRY_TRY_BLOCK:
|
||||
|
||||
CASE(OP_DEBUG) {
|
||||
/* A B C debug print R(A),R(B),R(C) */
|
||||
#ifdef ENABLE_DEBUG
|
||||
#ifdef MRB_ENABLE_DEBUG_HOOK
|
||||
mrb->debug_op_hook(mrb, irep, pc, regs);
|
||||
#else
|
||||
#ifdef ENABLE_STDIO
|
||||
#ifndef MRB_DISABLE_STDIO
|
||||
printf("OP_DEBUG %d %d %d\n", GETARG_A(i), GETARG_B(i), GETARG_C(i));
|
||||
#else
|
||||
abort();
|
||||
|
||||
Reference in New Issue
Block a user