mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Add constant export declaration for MRBC output compiled as C++
Otherwise, C++ compilers will skip this constant when producing object files.
This commit is contained in:
committed by
Yukihiro "Matz" Matsumoto
parent
1af9e363f2
commit
401ad4586f
@@ -1059,6 +1059,7 @@ mrb_dump_irep_cfunc(mrb_state *mrb, mrb_irep *irep, uint8_t flags, FILE *fp, con
|
||||
return MRB_DUMP_WRITE_FAULT;
|
||||
}
|
||||
if (fprintf(fp,
|
||||
"extern const uint8_t %s[];\n"
|
||||
"const uint8_t\n"
|
||||
"#if defined __GNUC__\n"
|
||||
"__attribute__((aligned(%u)))\n"
|
||||
@@ -1066,6 +1067,7 @@ mrb_dump_irep_cfunc(mrb_state *mrb, mrb_irep *irep, uint8_t flags, FILE *fp, con
|
||||
"__declspec(align(%u))\n"
|
||||
"#endif\n"
|
||||
"%s[] = {",
|
||||
initname,
|
||||
(uint16_t)MRB_DUMP_ALIGNMENT, (uint16_t)MRB_DUMP_ALIGNMENT, initname) < 0) {
|
||||
mrb_free(mrb, bin);
|
||||
return MRB_DUMP_WRITE_FAULT;
|
||||
|
||||
Reference in New Issue
Block a user