mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
throw.h: avoid using static member in C++ struct; fix #5846
The initialization causes linkage error with gcc (not clang), caused by the following gcc bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86254
This commit is contained in:
@@ -52,14 +52,15 @@ typedef mrb_int mrb_jmpbuf_impl;
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(MRB_USE_CXX_EXCEPTION)
|
||||
extern mrb_int mrb_jmpbuf_id;
|
||||
#endif
|
||||
|
||||
struct mrb_jmpbuf {
|
||||
mrb_jmpbuf_impl impl;
|
||||
|
||||
#if defined(MRB_USE_CXX_EXCEPTION)
|
||||
static mrb_int jmpbuf_id;
|
||||
# if defined(__cplusplus)
|
||||
mrb_jmpbuf() : impl(jmpbuf_id++) {}
|
||||
# endif
|
||||
mrb_jmpbuf() : impl(mrb_jmpbuf_id++) {}
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user