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:
+13
-11
@@ -75,23 +75,25 @@
|
||||
/* fixed size state atexit stack */
|
||||
//#define MRB_FIXED_STATE_ATEXIT_STACK
|
||||
|
||||
/* -DDISABLE_XXXX to drop following features */
|
||||
//#define DISABLE_STDIO /* use of stdio */
|
||||
/* -DMRB_DISABLE_XXXX to drop following features */
|
||||
//#define MRB_DISABLE_STDIO /* use of stdio */
|
||||
|
||||
/* -DENABLE_XXXX to enable following features */
|
||||
//#define ENABLE_DEBUG /* hooks for debugger */
|
||||
/* -DMRB_ENABLE_XXXX to enable following features */
|
||||
//#define MRB_ENABLE_DEBUG_HOOK /* hooks for debugger */
|
||||
|
||||
/* end of configuration */
|
||||
|
||||
/* define ENABLE_XXXX from DISABLE_XXX */
|
||||
#ifndef DISABLE_STDIO
|
||||
#define ENABLE_STDIO
|
||||
#endif
|
||||
#ifndef ENABLE_DEBUG
|
||||
#define DISABLE_DEBUG
|
||||
/* define MRB_DISABLE_XXXX from DISABLE_XXX (for compatibility) */
|
||||
#ifdef DISABLE_STDIO
|
||||
#define MRB_DIABLE_STDIO
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_STDIO
|
||||
/* define MRB_ENABLE_XXXX from ENABLE_XXX (for compatibility) */
|
||||
#ifdef ENABLE_DEBUG
|
||||
#define MRB_ENABLE_DEBUG_HOOK
|
||||
#endif
|
||||
|
||||
#ifndef MRB_DISABLE_STDIO
|
||||
# include <stdio.h>
|
||||
#endif
|
||||
|
||||
|
||||
+1
-1
@@ -152,7 +152,7 @@ typedef struct mrb_state {
|
||||
struct symbol_name *symtbl; /* symbol table */
|
||||
size_t symcapa;
|
||||
|
||||
#ifdef ENABLE_DEBUG
|
||||
#ifdef MRB_ENABLE_DEBUG_HOOK
|
||||
void (*code_fetch_hook)(struct mrb_state* mrb, struct mrb_irep *irep, mrb_code *pc, mrb_value *regs);
|
||||
void (*debug_op_hook)(struct mrb_state* mrb, struct mrb_irep *irep, mrb_code *pc, mrb_value *regs);
|
||||
#endif
|
||||
|
||||
@@ -112,7 +112,7 @@ struct mrb_parser_state {
|
||||
struct mrb_pool *pool;
|
||||
mrb_ast_node *cells;
|
||||
const char *s, *send;
|
||||
#ifdef ENABLE_STDIO
|
||||
#ifndef MRB_DIABLE_STDIO
|
||||
FILE *f;
|
||||
#endif
|
||||
mrbc_context *cxt;
|
||||
@@ -167,7 +167,7 @@ MRB_API void mrb_parser_set_filename(struct mrb_parser_state*, char const*);
|
||||
MRB_API char const* mrb_parser_get_filename(struct mrb_parser_state*, uint16_t idx);
|
||||
|
||||
/* utility functions */
|
||||
#ifdef ENABLE_STDIO
|
||||
#ifndef MRB_DISABLE_STDIO
|
||||
MRB_API struct mrb_parser_state* mrb_parse_file(mrb_state*,FILE*,mrbc_context*);
|
||||
#endif
|
||||
MRB_API struct mrb_parser_state* mrb_parse_string(mrb_state*,const char*,mrbc_context*);
|
||||
@@ -175,14 +175,12 @@ MRB_API struct mrb_parser_state* mrb_parse_nstring(mrb_state*,const char*,int,mr
|
||||
MRB_API struct RProc* mrb_generate_code(mrb_state*, struct mrb_parser_state*);
|
||||
|
||||
/* program load functions */
|
||||
#ifdef ENABLE_STDIO
|
||||
#ifndef MRB_DISABLE_STDIO
|
||||
MRB_API mrb_value mrb_load_file(mrb_state*,FILE*);
|
||||
MRB_API mrb_value mrb_load_file_cxt(mrb_state*,FILE*, mrbc_context *cxt);
|
||||
#endif
|
||||
MRB_API mrb_value mrb_load_string(mrb_state *mrb, const char *s);
|
||||
MRB_API mrb_value mrb_load_nstring(mrb_state *mrb, const char *s, int len);
|
||||
#ifdef ENABLE_STDIO
|
||||
MRB_API mrb_value mrb_load_file_cxt(mrb_state*,FILE*, mrbc_context *cxt);
|
||||
#endif
|
||||
MRB_API mrb_value mrb_load_string_cxt(mrb_state *mrb, const char *s, mrbc_context *cxt);
|
||||
MRB_API mrb_value mrb_load_nstring_cxt(mrb_state *mrb, const char *s, int len, mrbc_context *cxt);
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ MRB_BEGIN_DECL
|
||||
#define DUMP_ENDIAN_MASK 6
|
||||
|
||||
int mrb_dump_irep(mrb_state *mrb, mrb_irep *irep, uint8_t flags, uint8_t **bin, size_t *bin_size);
|
||||
#ifdef ENABLE_STDIO
|
||||
#ifndef MRB_DISABLE_STDIO
|
||||
int mrb_dump_irep_binary(mrb_state*, mrb_irep*, uint8_t, FILE*);
|
||||
int mrb_dump_irep_cfunc(mrb_state *mrb, mrb_irep*, uint8_t flags, FILE *f, const char *initname);
|
||||
mrb_irep *mrb_read_irep_file(mrb_state*, FILE*);
|
||||
|
||||
Reference in New Issue
Block a user