mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Symbols should work with MRB_USE_ALL_SYMBOLS; fix #5116
This commit is contained in:
@@ -8,7 +8,11 @@
|
||||
#define MRUBY_PRESYM_H
|
||||
|
||||
#undef MRB_PRESYM_MAX
|
||||
#ifdef MRB_USE_ALL_SYMBOLS
|
||||
#define MRB_PRESYM_NAMED(lit, num, type, name) MRB_##type##__##name = (num),
|
||||
#else
|
||||
#define MRB_PRESYM_NAMED(lit, num, type, name) MRB_##type##__##name = (num<<1),
|
||||
#endif
|
||||
#define MRB_PRESYM_UNNAMED(lit, num)
|
||||
|
||||
enum mruby_presym {
|
||||
|
||||
@@ -26,8 +26,7 @@ mrb_sym_all_symbols(mrb_state *mrb, mrb_value self)
|
||||
mrb_value ary = mrb_ary_new_capa(mrb, mrb->symidx);
|
||||
|
||||
for (i=1, lim=mrb->symidx+1; i<lim; i++) {
|
||||
mrb_sym sym = i<<1;
|
||||
mrb_ary_push(mrb, ary, mrb_symbol_value(sym));
|
||||
mrb_ary_push(mrb, ary, mrb_symbol_value(i+MRB_PRESYM_MAX));
|
||||
}
|
||||
|
||||
return ary;
|
||||
|
||||
Reference in New Issue
Block a user