10#if defined(MRB_USE_CXX_ABI) && !defined(__cplusplus)
11# error Trying to use C++ exception handling in C code
14#if defined(MRB_USE_CXX_EXCEPTION)
16# if defined(__cplusplus)
18#define MRB_TRY(buf) try {
19#define MRB_CATCH(buf) } catch(mrb_jmpbuf_impl e) { if (e != (buf)->impl) { throw e; }
20#define MRB_END_EXC(buf) }
22#define MRB_THROW(buf) throw((buf)->impl)
23typedef mrb_int mrb_jmpbuf_impl;
26# error "need to be compiled with C++ compiler"
33#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
34#define MRB_SETJMP _setjmp
35#define MRB_LONGJMP _longjmp
36#elif defined(__MINGW64__) && defined(__GNUC__) && __GNUC__ >= 4
37#define MRB_SETJMP __builtin_setjmp
38#define MRB_LONGJMP __builtin_longjmp
40#define MRB_SETJMP setjmp
41#define MRB_LONGJMP longjmp
44#define MRB_TRY(buf) if (MRB_SETJMP((buf)->impl) == 0) {
45#define MRB_CATCH(buf) } else {
46#define MRB_END_EXC(buf) }
48#define MRB_THROW(buf) MRB_LONGJMP((buf)->impl, 1);
49#define mrb_jmpbuf_impl jmp_buf
53#if defined(MRB_USE_CXX_EXCEPTION)
54extern mrb_int mrb_jmpbuf_id;
60#if defined(MRB_USE_CXX_EXCEPTION)