mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Rename MRB_{ENABLE,DISABLE}_ to MRB_{USE,NO}_; close #5163
| Previous Name | New Name | |------------------------------|-------------------------| | MRB_ENABLE_ALL_SYMBOLS | MRB_USE_ALL_SYMBOLS | | MRB_ENABLE_SYMBOLL_ALL | MRB_USE_ALL_SYMBOLS | | MRB_ENABLE_CXX_ABI | MRB_USE_CXX_ABI | | MRB_ENABLE_CXX_EXCEPTION | MRB_USE_CXX_EXCEPTION | | MRB_ENABLE_DEBUG_HOOK | MRB_USE_DEBUG_HOOK | | MRB_DISABLE_DIRECT_THREADING | MRB_NO_DIRECT_THREADING | | MRB_DISABLE_STDIO | MRB_NO_STDIO | | ENABLE_LINENOISE | MRB_USE_LINENOISE | | ENABLE_READLINE | MRB_USE_READLINE | | DISABLE_MIRB_UNDERSCORE | MRB_NO_MIRB_UNDERSCORE | | DISABLE_GEMS | MRB_NO_GEMS | * `MRB_ENABLE_SYMBOLL_ALL` seems to be a typo, so it is fixed. * `MRB_` prefix is added to those without. * The previous names can also be used for compatibility.
This commit is contained in:
+1
-1
@@ -74,7 +74,7 @@ each_backtrace(mrb_state *mrb, ptrdiff_t ciidx, const mrb_code *pc0, each_backtr
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef MRB_DISABLE_STDIO
|
||||
#ifndef MRB_NO_STDIO
|
||||
|
||||
static void
|
||||
print_backtrace(mrb_state *mrb, struct RObject *exc, mrb_value backtrace)
|
||||
|
||||
+2
-2
@@ -6,7 +6,7 @@
|
||||
#include <mruby/proc.h>
|
||||
#include <mruby/dump.h>
|
||||
|
||||
#ifndef MRB_DISABLE_STDIO
|
||||
#ifndef MRB_NO_STDIO
|
||||
static void
|
||||
print_r(mrb_state *mrb, const mrb_irep *irep, size_t n)
|
||||
{
|
||||
@@ -556,7 +556,7 @@ codedump_recur(mrb_state *mrb, const mrb_irep *irep)
|
||||
void
|
||||
mrb_codedump_all(mrb_state *mrb, struct RProc *proc)
|
||||
{
|
||||
#ifndef MRB_DISABLE_STDIO
|
||||
#ifndef MRB_NO_STDIO
|
||||
codedump_recur(mrb, proc->body.irep);
|
||||
#endif
|
||||
}
|
||||
|
||||
+2
-2
@@ -874,7 +874,7 @@ mrb_dump_irep(mrb_state *mrb, const mrb_irep *irep, uint8_t flags, uint8_t **bin
|
||||
return dump_irep(mrb, irep, flags, bin, bin_size);
|
||||
}
|
||||
|
||||
#ifndef MRB_DISABLE_STDIO
|
||||
#ifndef MRB_NO_STDIO
|
||||
|
||||
int
|
||||
mrb_dump_irep_binary(mrb_state *mrb, const mrb_irep *irep, uint8_t flags, FILE* fp)
|
||||
@@ -1112,4 +1112,4 @@ mrb_dump_irep_cstruct(mrb_state *mrb, const mrb_irep *irep, uint8_t flags, FILE
|
||||
return MRB_DUMP_OK;
|
||||
}
|
||||
|
||||
#endif /* MRB_DISABLE_STDIO */
|
||||
#endif /* MRB_NO_STDIO */
|
||||
|
||||
+2
-2
@@ -420,7 +420,7 @@ mrb_name_error(mrb_state *mrb, mrb_sym id, const char *fmt, ...)
|
||||
MRB_API void
|
||||
mrb_warn(mrb_state *mrb, const char *fmt, ...)
|
||||
{
|
||||
#ifndef MRB_DISABLE_STDIO
|
||||
#ifndef MRB_NO_STDIO
|
||||
va_list ap;
|
||||
mrb_value str;
|
||||
|
||||
@@ -436,7 +436,7 @@ mrb_warn(mrb_state *mrb, const char *fmt, ...)
|
||||
MRB_API mrb_noreturn void
|
||||
mrb_bug(mrb_state *mrb, const char *fmt, ...)
|
||||
{
|
||||
#ifndef MRB_DISABLE_STDIO
|
||||
#ifndef MRB_NO_STDIO
|
||||
va_list ap;
|
||||
mrb_value str;
|
||||
|
||||
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
#ifndef MRB_NO_FLOAT
|
||||
#if defined(MRB_DISABLE_STDIO) || defined(_WIN32) || defined(_WIN64)
|
||||
#if defined(MRB_NO_STDIO) || defined(_WIN32) || defined(_WIN64)
|
||||
/*
|
||||
|
||||
Most code in this file originates from musl (src/stdio/vfprintf.c)
|
||||
@@ -442,7 +442,7 @@ mrb_float_to_cstr(mrb_state *mrb, char *buf, size_t len, const char *fmt, mrb_fl
|
||||
*cstr.buf = '\0';
|
||||
return (int)(cstr.buf - buf);
|
||||
}
|
||||
#else /* MRB_DISABLE_STDIO || _WIN32 || _WIN64 */
|
||||
#else /* MRB_NO_STDIO || _WIN32 || _WIN64 */
|
||||
#include <mruby.h>
|
||||
#include <stdio.h>
|
||||
|
||||
@@ -460,5 +460,5 @@ mrb_float_to_cstr(mrb_state *mrb, char *buf, size_t len, const char *fmt, mrb_fl
|
||||
{
|
||||
return snprintf(buf, len, fmt, fval);
|
||||
}
|
||||
#endif /* MRB_DISABLE_STDIO || _WIN32 || _WIN64 */
|
||||
#endif /* MRB_NO_STDIO || _WIN32 || _WIN64 */
|
||||
#endif
|
||||
|
||||
+2
-2
@@ -685,7 +685,7 @@ mrb_load_proc(mrb_state *mrb, const struct RProc *proc)
|
||||
return mrb_vm_run(mrb, proc, mrb_top_self(mrb), 0);
|
||||
}
|
||||
|
||||
#ifndef MRB_DISABLE_STDIO
|
||||
#ifndef MRB_NO_STDIO
|
||||
|
||||
mrb_irep*
|
||||
mrb_read_irep_file(mrb_state *mrb, FILE* fp)
|
||||
@@ -732,4 +732,4 @@ mrb_load_irep_file(mrb_state *mrb, FILE* fp)
|
||||
{
|
||||
return mrb_load_irep_file_cxt(mrb, fp, NULL);
|
||||
}
|
||||
#endif /* MRB_DISABLE_STDIO */
|
||||
#endif /* MRB_NO_STDIO */
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@
|
||||
#include <mruby/error.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifndef MRB_DISABLE_STDIO
|
||||
#ifndef MRB_NO_STDIO
|
||||
static void
|
||||
printcstr(const char *str, size_t len, FILE *stream)
|
||||
{
|
||||
|
||||
+2
-2
@@ -77,7 +77,7 @@ mrb_open(void)
|
||||
return mrb;
|
||||
}
|
||||
|
||||
#ifndef DISABLE_GEMS
|
||||
#ifndef MRB_NO_GEMS
|
||||
static void
|
||||
init_mrbgems(mrb_state *mrb, void *opaque)
|
||||
{
|
||||
@@ -94,7 +94,7 @@ mrb_open_allocf(mrb_allocf f, void *ud)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#ifndef DISABLE_GEMS
|
||||
#ifndef MRB_NO_GEMS
|
||||
if (mrb_core_init_protect(mrb, init_mrbgems, NULL)) {
|
||||
mrb_close(mrb);
|
||||
return NULL;
|
||||
|
||||
+2
-2
@@ -69,7 +69,7 @@ typedef struct symbol_name {
|
||||
const char *name;
|
||||
} symbol_name;
|
||||
|
||||
#ifdef MRB_ENABLE_ALL_SYMBOLS
|
||||
#ifdef MRB_USE_ALL_SYMBOLS
|
||||
#define SYMBOL_SHIFT 0
|
||||
# define SYMBOL_INLINE_P(sym) FALSE
|
||||
# define sym_inline_pack(name, len) 0
|
||||
@@ -88,7 +88,7 @@ sym_validate_len(mrb_state *mrb, size_t len)
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef MRB_ENABLE_ALL_SYMBOLS
|
||||
#ifndef MRB_USE_ALL_SYMBOLS
|
||||
static const char pack_table[] = "_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
|
||||
|
||||
static mrb_sym
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include <mruby/throw.h>
|
||||
#include <mruby/dump.h>
|
||||
|
||||
#ifdef MRB_DISABLE_STDIO
|
||||
#ifdef MRB_NO_STDIO
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
@@ -935,7 +935,7 @@ prepare_tagged_break(mrb_state *mrb, uint32_t tag, const struct RProc *proc, mrb
|
||||
|
||||
#define ERR_PC_SET(mrb) mrb->c->ci->err = pc0;
|
||||
#define ERR_PC_CLR(mrb) mrb->c->ci->err = 0;
|
||||
#ifdef MRB_ENABLE_DEBUG_HOOK
|
||||
#ifdef MRB_USE_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)
|
||||
@@ -947,11 +947,11 @@ prepare_tagged_break(mrb_state *mrb, uint32_t tag, const struct RProc *proc, mrb
|
||||
#define BYTECODE_DECODER(x) (x)
|
||||
#endif
|
||||
|
||||
#ifndef MRB_DISABLE_DIRECT_THREADING
|
||||
#ifndef MRB_NO_DIRECT_THREADING
|
||||
#if defined __GNUC__ || defined __clang__ || defined __INTEL_COMPILER
|
||||
#define DIRECT_THREADED
|
||||
#endif
|
||||
#endif /* ifndef MRB_DISABLE_DIRECT_THREADING */
|
||||
#endif /* ifndef MRB_NO_DIRECT_THREADING */
|
||||
|
||||
#ifndef DIRECT_THREADED
|
||||
|
||||
@@ -2797,10 +2797,10 @@ RETRY_TRY_BLOCK:
|
||||
|
||||
CASE(OP_DEBUG, Z) {
|
||||
FETCH_BBB();
|
||||
#ifdef MRB_ENABLE_DEBUG_HOOK
|
||||
#ifdef MRB_USE_DEBUG_HOOK
|
||||
mrb->debug_op_hook(mrb, irep, pc, regs);
|
||||
#else
|
||||
#ifndef MRB_DISABLE_STDIO
|
||||
#ifndef MRB_NO_STDIO
|
||||
printf("OP_DEBUG %d %d %d\n", a, b, c);
|
||||
#else
|
||||
abort();
|
||||
@@ -2887,12 +2887,12 @@ mrb_top_run(mrb_state *mrb, const struct RProc *proc, mrb_value self, mrb_int st
|
||||
return v;
|
||||
}
|
||||
|
||||
#if defined(MRB_ENABLE_CXX_EXCEPTION) && defined(__cplusplus)
|
||||
# if !defined(MRB_ENABLE_CXX_ABI)
|
||||
#if defined(MRB_USE_CXX_EXCEPTION) && defined(__cplusplus)
|
||||
# if !defined(MRB_USE_CXX_ABI)
|
||||
} /* end of extern "C" */
|
||||
# endif
|
||||
mrb_int mrb_jmpbuf::jmpbuf_id = 0;
|
||||
# if !defined(MRB_ENABLE_CXX_ABI)
|
||||
# if !defined(MRB_USE_CXX_ABI)
|
||||
extern "C" {
|
||||
# endif
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user