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:
Yukihiro "Matz" Matsumoto
2021-01-21 14:53:18 +09:00
45 changed files with 1050 additions and 1009 deletions
+20 -18
View File
@@ -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 */
-2
View File
@@ -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
+2 -4
View File
@@ -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
-1
View File
@@ -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)