Changeset 331 for EcnlProtoTool/trunk/mruby-1.3.0/include/mruby/throw.h
- Timestamp:
- Jan 21, 2018, 12:10:09 AM (6 years ago)
- Location:
- EcnlProtoTool/trunk/mruby-1.3.0
- Files:
-
- 1 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
EcnlProtoTool/trunk/mruby-1.3.0/include/mruby/throw.h
r321 r331 8 8 #define MRB_THROW_H 9 9 10 #ifdef MRB_ENABLE_CXX_EXCEPTION 10 #if defined(MRB_ENABLE_CXX_ABI) 11 # if !defined(__cplusplus) 12 # error Trying to use C++ exception handling in C code 13 # endif 14 #endif 15 16 #if defined(MRB_ENABLE_CXX_EXCEPTION) && defined(__cplusplus) 11 17 12 18 #define MRB_TRY(buf) do { try { … … 21 27 #include <setjmp.h> 22 28 23 #define MRB_TRY(buf) do { if (setjmp((buf)->impl) == 0) { 29 #if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) 30 #define MRB_SETJMP _setjmp 31 #define MRB_LONGJMP _longjmp 32 #else 33 #define MRB_SETJMP setjmp 34 #define MRB_LONGJMP longjmp 35 #endif 36 37 #define MRB_TRY(buf) do { if (MRB_SETJMP((buf)->impl) == 0) { 24 38 #define MRB_CATCH(buf) } else { 25 39 #define MRB_END_EXC(buf) } } while(0) 26 40 27 #define MRB_THROW(buf) longjmp((buf)->impl, 1);41 #define MRB_THROW(buf) MRB_LONGJMP((buf)->impl, 1); 28 42 #define mrb_jmpbuf_impl jmp_buf 29 43 … … 33 47 mrb_jmpbuf_impl impl; 34 48 35 #if def MRB_ENABLE_CXX_EXCEPTION49 #if defined(MRB_ENABLE_CXX_EXCEPTION) && defined(__cplusplus) 36 50 static mrb_int jmpbuf_id; 37 51 mrb_jmpbuf() : impl(jmpbuf_id++) {}
Note:
See TracChangeset
for help on using the changeset viewer.