mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Merge branch 'avoid-including-presym.inc-in-existing-header-files' of https://github.com/shuujii/mruby into shuujii-avoid-including-presym.inc-in-existing-header-files
This commit is contained in:
+20
-18
@@ -1303,26 +1303,26 @@ MRB_API mrb_value mrb_vformat(mrb_state *mrb, const char *format, va_list ap);
|
||||
+ those E_* macros requires mrb_state* variable named mrb.
|
||||
+ exception objects obtained from those macros are local to mrb
|
||||
*/
|
||||
#define E_RUNTIME_ERROR (mrb_exc_get_id(mrb, MRB_SYM(RuntimeError)))
|
||||
#define E_TYPE_ERROR (mrb_exc_get_id(mrb, MRB_SYM(TypeError)))
|
||||
#define E_ZERODIV_ERROR (mrb_exc_get_id(mrb, MRB_SYM(ZeroDivisionError)))
|
||||
#define E_ARGUMENT_ERROR (mrb_exc_get_id(mrb, MRB_SYM(ArgumentError)))
|
||||
#define E_INDEX_ERROR (mrb_exc_get_id(mrb, MRB_SYM(IndexError)))
|
||||
#define E_RANGE_ERROR (mrb_exc_get_id(mrb, MRB_SYM(RangeError)))
|
||||
#define E_NAME_ERROR (mrb_exc_get_id(mrb, MRB_SYM(NameError)))
|
||||
#define E_NOMETHOD_ERROR (mrb_exc_get_id(mrb, MRB_SYM(NoMethodError)))
|
||||
#define E_SCRIPT_ERROR (mrb_exc_get_id(mrb, MRB_SYM(ScriptError)))
|
||||
#define E_SYNTAX_ERROR (mrb_exc_get_id(mrb, MRB_SYM(SyntaxError)))
|
||||
#define E_LOCALJUMP_ERROR (mrb_exc_get_id(mrb, MRB_SYM(LocalJumpError)))
|
||||
#define E_REGEXP_ERROR (mrb_exc_get_id(mrb, MRB_SYM(RegexpError)))
|
||||
#define E_FROZEN_ERROR (mrb_exc_get_id(mrb, MRB_SYM(FrozenError)))
|
||||
#define E_RUNTIME_ERROR mrb_exc_get_id(mrb, mrb_intern_lit(mrb, "RuntimeError"))
|
||||
#define E_TYPE_ERROR mrb_exc_get_id(mrb, mrb_intern_lit(mrb, "TypeError"))
|
||||
#define E_ZERODIV_ERROR mrb_exc_get_id(mrb, mrb_intern_lit(mrb, "ZeroDivisionError"))
|
||||
#define E_ARGUMENT_ERROR mrb_exc_get_id(mrb, mrb_intern_lit(mrb, "ArgumentError"))
|
||||
#define E_INDEX_ERROR mrb_exc_get_id(mrb, mrb_intern_lit(mrb, "IndexError"))
|
||||
#define E_RANGE_ERROR mrb_exc_get_id(mrb, mrb_intern_lit(mrb, "RangeError"))
|
||||
#define E_NAME_ERROR mrb_exc_get_id(mrb, mrb_intern_lit(mrb, "NameError"))
|
||||
#define E_NOMETHOD_ERROR mrb_exc_get_id(mrb, mrb_intern_lit(mrb, "NoMethodError"))
|
||||
#define E_SCRIPT_ERROR mrb_exc_get_id(mrb, mrb_intern_lit(mrb, "ScriptError"))
|
||||
#define E_SYNTAX_ERROR mrb_exc_get_id(mrb, mrb_intern_lit(mrb, "SyntaxError"))
|
||||
#define E_LOCALJUMP_ERROR mrb_exc_get_id(mrb, mrb_intern_lit(mrb, "LocalJumpError"))
|
||||
#define E_REGEXP_ERROR mrb_exc_get_id(mrb, mrb_intern_lit(mrb, "RegexpError"))
|
||||
#define E_FROZEN_ERROR mrb_exc_get_id(mrb, mrb_intern_lit(mrb, "FrozenError"))
|
||||
|
||||
#define E_NOTIMP_ERROR (mrb_exc_get_id(mrb, MRB_SYM(NotImplementedError)))
|
||||
#define E_NOTIMP_ERROR mrb_exc_get_id(mrb, mrb_intern_lit(mrb, "NotImplementedError"))
|
||||
#ifndef MRB_NO_FLOAT
|
||||
#define E_FLOATDOMAIN_ERROR (mrb_exc_get_id(mrb, MRB_SYM(FloatDomainError)))
|
||||
#define E_FLOATDOMAIN_ERROR mrb_exc_get_id(mrb, mrb_intern_lit(mrb, "FloatDomainError"))
|
||||
#endif
|
||||
|
||||
#define E_KEY_ERROR (mrb_exc_get_id(mrb, MRB_SYM(KeyError)))
|
||||
#define E_KEY_ERROR mrb_exc_get_id(mrb, mrb_intern_lit(mrb, "KeyError"))
|
||||
|
||||
MRB_API mrb_value mrb_yield(mrb_state *mrb, mrb_value b, mrb_value arg);
|
||||
MRB_API mrb_value mrb_yield_argv(mrb_state *mrb, mrb_value b, mrb_int argc, const mrb_value *argv);
|
||||
@@ -1389,7 +1389,7 @@ MRB_API mrb_value mrb_fiber_alive_p(mrb_state *mrb, mrb_value fib);
|
||||
*
|
||||
* Implemented in mruby-fiber
|
||||
*/
|
||||
#define E_FIBER_ERROR (mrb_exc_get_id(mrb, MRB_SYM(FiberError)))
|
||||
#define E_FIBER_ERROR mrb_exc_get_id(mrb, mrb_intern_lit(mrb, "FiberError"))
|
||||
MRB_API void mrb_stack_extend(mrb_state*, mrb_int);
|
||||
|
||||
/* memory pool implementation */
|
||||
@@ -1409,7 +1409,9 @@ MRB_API void mrb_show_copyright(mrb_state *mrb);
|
||||
|
||||
MRB_API mrb_value mrb_format(mrb_state *mrb, const char *format, ...);
|
||||
|
||||
#include <mruby/presym.h>
|
||||
#ifdef MRB_PRESYM_SCANNING
|
||||
# include <mruby/presym/scanning.h>
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
/* memcpy and memset does not work with gdb reverse-next on my box */
|
||||
|
||||
@@ -212,8 +212,6 @@ MRB_API mrb_value mrb_hash_dup(mrb_state *mrb, mrb_value hash);
|
||||
MRB_API void mrb_hash_merge(mrb_state *mrb, mrb_value hash1, mrb_value hash2);
|
||||
|
||||
#define RHASH(hash) ((struct RHash*)(mrb_ptr(hash)))
|
||||
#define RHASH_IFNONE(hash) mrb_iv_get(mrb, (hash), MRB_SYM(ifnone))
|
||||
#define RHASH_PROCDEFAULT(hash) RHASH_IFNONE(hash)
|
||||
|
||||
#define MRB_HASH_IB_BIT_BIT 5
|
||||
#define MRB_HASH_AR_EA_CAPA_BIT 5
|
||||
|
||||
@@ -7,11 +7,9 @@
|
||||
#ifndef MRUBY_PRESYM_H
|
||||
#define MRUBY_PRESYM_H
|
||||
|
||||
#if defined(MRB_PRESYM_SCANNING)
|
||||
# include <mruby/presym/scanning.h>
|
||||
#elif defined(MRB_NO_PRESYM)
|
||||
#if defined(MRB_NO_PRESYM)
|
||||
# include <mruby/presym/disable.h>
|
||||
#else
|
||||
#elif !defined(MRB_PRESYM_SCANNING)
|
||||
# include <mruby/presym/enable.h>
|
||||
#endif
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
#define mrb_define_const(mrb, c, name, v) MRB_PRESYM_SCANNING_TAGGED(name)
|
||||
#define mrb_define_global_const(mrb, name, v) MRB_PRESYM_SCANNING_TAGGED(name)
|
||||
|
||||
|
||||
#define MRB_OPSYM(name) MRB_OPSYM__##name(mrb)
|
||||
#define MRB_CVSYM(name) MRB_PRESYM_SCANNING_TAGGED("@@" #name)
|
||||
#define MRB_IVSYM(name) MRB_PRESYM_SCANNING_TAGGED("@" #name)
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include <mruby/array.h>
|
||||
#include <mruby/range.h>
|
||||
#include <mruby/hash.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
/*
|
||||
* call-seq:
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include <mruby/error.h>
|
||||
#include <mruby/numeric.h>
|
||||
#include <mruby/string.h>
|
||||
#include <mruby/presym.h>
|
||||
#include "apiprint.h"
|
||||
|
||||
static void
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include <mruby/dump.h>
|
||||
#include <mruby/string.h>
|
||||
#include <mruby/variable.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include <mruby/numeric.h>
|
||||
#include <mruby/string.h>
|
||||
#include <mruby/debug.h>
|
||||
#include <mruby/presym.h>
|
||||
#include "node.h"
|
||||
#include <mruby/opcode.h>
|
||||
#include <mruby/re.h>
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include <mruby/throw.h>
|
||||
#include <mruby/string.h>
|
||||
#include <mruby/dump.h>
|
||||
#include <mruby/presym.h>
|
||||
#include "node.h"
|
||||
|
||||
#define YYLEX_PARAM p
|
||||
|
||||
+983
-982
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,7 @@
|
||||
#include <mruby.h>
|
||||
#include <mruby/class.h>
|
||||
#include <mruby/numeric.h>
|
||||
#include <mruby/presym.h>
|
||||
#include <math.h>
|
||||
|
||||
#ifdef MRB_NO_FLOAT
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include <mruby/proc.h>
|
||||
#include <mruby/opcode.h>
|
||||
#include <mruby/error.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
struct REnv *mrb_env_new(mrb_state *mrb, struct mrb_context *c, mrb_callinfo *ci, int nstacks, mrb_value *stack, struct RClass *tc);
|
||||
mrb_value mrb_exec_irep(mrb_state *mrb, mrb_value self, struct RProc *p);
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "mruby/string.h"
|
||||
#include "mruby/ext/io.h"
|
||||
#include "mruby/error.h"
|
||||
#include "mruby/presym.h"
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "mruby/variable.h"
|
||||
#include "mruby/ext/io.h"
|
||||
#include "mruby/error.h"
|
||||
#include "mruby/presym.h"
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include <mruby/array.h>
|
||||
#include <mruby/hash.h>
|
||||
#include <mruby/range.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
static mrb_value
|
||||
mrb_f_caller(mrb_state *mrb, mrb_value self)
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#endif
|
||||
|
||||
#include <mruby/array.h>
|
||||
#include <mruby/presym.h>
|
||||
#include <math.h>
|
||||
|
||||
static void
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "mruby/proc.h"
|
||||
#include "mruby/class.h"
|
||||
#include "mruby/string.h"
|
||||
#include "mruby/presym.h"
|
||||
|
||||
typedef enum {
|
||||
NOEX_PUBLIC = 0x00,
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "mruby/variable.h"
|
||||
#include "mruby/proc.h"
|
||||
#include "mruby/string.h"
|
||||
#include "mruby/presym.h"
|
||||
|
||||
static struct RObject *
|
||||
method_object_alloc(mrb_state *mrb, struct RClass *mclass)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include <limits.h>
|
||||
#include <mruby.h>
|
||||
#include <mruby/numeric.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
/*
|
||||
* call-seq:
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include <mruby/class.h>
|
||||
#include <mruby/hash.h>
|
||||
#include <mruby/proc.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
/*
|
||||
* call-seq:
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include <mruby/proc.h>
|
||||
#include <mruby/value.h>
|
||||
#include <mruby/range.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
struct os_count_struct {
|
||||
mrb_int total;
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include <mruby/array.h>
|
||||
#include <mruby/string.h>
|
||||
#include <mruby/debug.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
static mrb_value
|
||||
mrb_proc_lambda_p(mrb_state *mrb, mrb_value self)
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include <mruby/data.h>
|
||||
#include <mruby/array.h>
|
||||
#include <mruby/istruct.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
#include <time.h>
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include <mruby/class.h>
|
||||
#include <mruby/string.h>
|
||||
#include <mruby/numeric.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
struct mrb_rational {
|
||||
mrb_int numerator;
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
#include "mruby/string.h"
|
||||
#include "mruby/variable.h"
|
||||
#include "mruby/error.h"
|
||||
#include "mruby/presym.h"
|
||||
|
||||
#include "mruby/ext/io.h"
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include <mruby/string.h>
|
||||
#include <mruby/hash.h>
|
||||
#include <mruby/numeric.h>
|
||||
#include <mruby/presym.h>
|
||||
#ifndef MRB_NO_FLOAT
|
||||
#include <math.h>
|
||||
#endif
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include <mruby/hash.h>
|
||||
#include <mruby/range.h>
|
||||
#include <mruby/proc.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
#define RSTRUCT_LEN(st) RARRAY_LEN(st)
|
||||
#define RSTRUCT_PTR(st) RARRAY_PTR(st)
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include <mruby/numeric.h>
|
||||
#include <mruby/time.h>
|
||||
#include <mruby/string.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
#ifdef MRB_NO_STDIO
|
||||
#include <string.h>
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@
|
||||
#include <mruby/string.h>
|
||||
#include <mruby/range.h>
|
||||
#include <mruby/proc.h>
|
||||
#include <mruby/opcode.h>
|
||||
#include <mruby/presym.h>
|
||||
#include "value_array.h"
|
||||
|
||||
#define ARY_DEFAULT_LEN 4
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include <mruby/error.h>
|
||||
#include <mruby/numeric.h>
|
||||
#include <mruby/data.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
struct backtrace_location {
|
||||
int32_t lineno;
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include <mruby/data.h>
|
||||
#include <mruby/istruct.h>
|
||||
#include <mruby/opcode.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
union mt_ptr {
|
||||
struct RProc *proc;
|
||||
|
||||
+4
-1
@@ -1216,7 +1216,10 @@ mrb_dump_irep_cstruct(mrb_state *mrb, const mrb_irep *irep, uint8_t flags, FILE
|
||||
if (fp == NULL || initname == NULL || initname[0] == '\0') {
|
||||
return MRB_DUMP_INVALID_ARGUMENT;
|
||||
}
|
||||
if (fprintf(fp, "#include <mruby.h>\n" "#include <mruby/proc.h>\n\n") < 0) {
|
||||
if (fprintf(fp, "#include <mruby.h>\n"
|
||||
"#include <mruby/proc.h>\n"
|
||||
"#include <mruby/presym.h>\n"
|
||||
"\n") < 0) {
|
||||
return MRB_DUMP_WRITE_FAULT;
|
||||
}
|
||||
fputs("#define mrb_BRACED(...) {__VA_ARGS__}\n", fp);
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include <mruby/error.h>
|
||||
#include <mruby/class.h>
|
||||
#include <mruby/throw.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
MRB_API mrb_value
|
||||
mrb_exc_new(mrb_state *mrb, struct RClass *c, const char *ptr, size_t len)
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include <mruby/gc.h>
|
||||
#include <mruby/error.h>
|
||||
#include <mruby/throw.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
/*
|
||||
= Tri-color Incremental Garbage Collection
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include <mruby/hash.h>
|
||||
#include <mruby/string.h>
|
||||
#include <mruby/variable.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
/*
|
||||
* === Glossary
|
||||
@@ -254,6 +255,8 @@ HT_ASSERT_SAFE_READ(ea_capa);
|
||||
#define h_ar_p(h) (!h_ht_p(h))
|
||||
#define h_ar_on(h) h_ht_off(h)
|
||||
#define lesser(a, b) ((a) < (b) ? (a) : (b))
|
||||
#define RHASH_IFNONE(hash) mrb_iv_get(mrb, (hash), MRB_SYM(ifnone))
|
||||
#define RHASH_PROCDEFAULT(hash) RHASH_IFNONE(hash)
|
||||
|
||||
static uint32_t ib_upper_bound_for(uint32_t capa);
|
||||
static uint32_t ib_bit_to_capa(uint32_t bit);
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include <mruby/variable.h>
|
||||
#include <mruby/error.h>
|
||||
#include <mruby/istruct.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
MRB_API mrb_bool
|
||||
mrb_func_basic_p(mrb_state *mrb, mrb_value obj, mrb_sym mid, mrb_func_t func)
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include <mruby/numeric.h>
|
||||
#include <mruby/string.h>
|
||||
#include <mruby/class.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
#ifndef MRB_NO_FLOAT
|
||||
#ifdef MRB_USE_FLOAT32
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include <mruby/numeric.h>
|
||||
#include <mruby/string.h>
|
||||
#include <mruby/class.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
MRB_API mrb_bool
|
||||
mrb_obj_eq(mrb_state *mrb, mrb_value v1, mrb_value v2)
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include <mruby/string.h>
|
||||
#include <mruby/variable.h>
|
||||
#include <mruby/error.h>
|
||||
#include <mruby/presym.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifndef MRB_NO_STDIO
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include <mruby/proc.h>
|
||||
#include <mruby/opcode.h>
|
||||
#include <mruby/data.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
static const mrb_code call_iseq[] = {
|
||||
OP_CALL,
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include <mruby/range.h>
|
||||
#include <mruby/string.h>
|
||||
#include <mruby/array.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
#define RANGE_INITIALIZED_MASK 1
|
||||
#define RANGE_INITIALIZED(p) ((p)->flags |= RANGE_INITIALIZED_MASK)
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include <mruby/range.h>
|
||||
#include <mruby/string.h>
|
||||
#include <mruby/numeric.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
typedef struct mrb_shared_string {
|
||||
int refcnt;
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include <mruby/string.h>
|
||||
#include <mruby/dump.h>
|
||||
#include <mruby/class.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
#ifndef MRB_NO_PRESYM
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include <mruby/proc.h>
|
||||
#include <mruby/string.h>
|
||||
#include <mruby/variable.h>
|
||||
#include <mruby/presym.h>
|
||||
|
||||
struct iv_elem {
|
||||
mrb_sym key;
|
||||
|
||||
Reference in New Issue
Block a user