Use MRB_SYM() for error class retrieval; ref #5277

Note that `MRB_SYM()` is only available when `mruby/presym.h` is
included. Use `mrb_intern_lit()` otherwise.
This commit is contained in:
Yukihiro "Matz" Matsumoto
2021-01-26 11:13:06 +09:00
parent 17ecf14511
commit 2ddfd50df3
2 changed files with 11 additions and 0 deletions
+4
View File
@@ -38,4 +38,8 @@ enum mruby_presym {
static const mrb_sym name[] = {__VA_ARGS__}; \
static void init_##name(mrb_state *mrb) {}
/* use MRB_SYM() for E_RUNTIME_ERROR etc. */
# undef MRB_E_SYM
# define MRB_E_SYM(sym) MRB_SYM(sym)
#endif /* MRUBY_PRESYM_ENABLE_H */