Stringify non C identifier symbols to stop macro errors by old gcc.
MODIFY
Rakefile
Rakefile
@@ -181,24 +181,24 @@ file presym_inc => presym_file do
if /\A\w+\Z/ =~ sym
f.print "MRB_PRESYM_CSYM(#{sym}, #{i+1})\n"
elsif op_table.key?(sym)
- f.print "MRB_PRESYM_QSYM(#{sym}, #{op_table[sym]}, #{i+1})\n"
+ f.print "MRB_PRESYM_QSYM(\"#{sym}\", #{op_table[sym]}, #{i+1})\n"
elsif /\?\Z/ =~ sym
s = sym.dup; s[-1] = "_p"
- f.print "MRB_PRESYM_QSYM(#{sym}, #{s}, #{i+1})\n"
+ f.print "MRB_PRESYM_QSYM(\"#{sym}\", #{s}, #{i+1})\n"
elsif /\!\Z/ =~ sym
s = sym.dup; s[-1] = "_b"
- f.print "MRB_PRESYM_QSYM(#{sym}, #{s}, #{i+1})\n"
+ f.print "MRB_PRESYM_QSYM(\"#{sym}\", #{s}, #{i+1})\n"
elsif /\=\Z/ =~ sym
s = sym.dup; s[-1] = "_e"
- f.print "MRB_PRESYM_QSYM(#{sym}, #{s}, #{i+1})\n"
+ f.print "MRB_PRESYM_QSYM(\"#{sym}\", #{s}, #{i+1})\n"
elsif /\A@/ =~ sym
s = sym.dup; s[0] = "a_"
- f.print "MRB_PRESYM_QSYM(#{sym}, #{s}, #{i+1})\n"
+ f.print "MRB_PRESYM_QSYM(\"#{sym}\", #{s}, #{i+1})\n"
elsif /\A$/ =~ sym
s = sym.dup; s[0] = "d_"
- f.print "MRB_PRESYM_QSYM(#{sym}, #{s}, #{i+1})\n"
+ f.print "MRB_PRESYM_QSYM(\"#{sym}\", #{s}, #{i+1})\n"
else
- f.print "MRB_PRESYM_SYM(#{sym}, #{i+1})\n"
+ f.print "MRB_PRESYM_SYM(\"#{sym}\", #{i+1})\n"
end
end
f.print "#define MRB_PRESYM_MAX #{presyms.size}"

MODIFY
include/mruby/presym.h
include/mruby/presym.h
#undef MRB_PRESYM_MAX
#define MRB_PRESYM_CSYM(sym, num) MRB_PRESYM__##sym = (num<<1),
-#define MRB_PRESYM_QSYM(src, sym, num) MRB_PRESYM_q_##sym = (num<<1),
+#define MRB_PRESYM_QSYM(str, sym, num) MRB_PRESYM_q_##sym = (num<<1),
#define MRB_PRESYM_SYM(sym, num)
enum mruby_presym {

MODIFY
src/symbol.c
src/symbol.c
#undef MRB_PRESYM_QSYM
#undef MRB_PRESYM_SYM
#define MRB_PRESYM_CSYM(sym, num) #sym,
-#define MRB_PRESYM_QSYM(sym, name, num) #sym,
-#define MRB_PRESYM_SYM(sym, num) #sym,
+#define MRB_PRESYM_QSYM(str, name, num) str,
+#define MRB_PRESYM_SYM(str, num) str,
static const char *presym_table[] = {
#include <../build/presym.inc>

Stringify non C identifier symbols to stop macro errors by old gcc.