diff options
| author | Hiroshi Mimaki <[email protected]> | 2018-11-27 09:09:20 +0900 |
|---|---|---|
| committer | Hiroshi Mimaki <[email protected]> | 2018-11-27 09:09:20 +0900 |
| commit | e3ae0e4f2962418106875217adcd4f5971ce4689 (patch) | |
| tree | 3000278ca91d089918c3b6103aedcff71baed99d /include | |
| parent | 0711c861ca939c73bed9d91601f6cc38bdf474ba (diff) | |
| parent | 26475d0a7897c25f8632b776014a19c3a6f6ecc2 (diff) | |
| download | mruby-e3ae0e4f2962418106875217adcd4f5971ce4689.tar.gz mruby-e3ae0e4f2962418106875217adcd4f5971ce4689.zip | |
Merge branch 'master' into stable
Diffstat (limited to 'include')
| -rw-r--r-- | include/mruby/irep.h | 5 | ||||
| -rw-r--r-- | include/mruby/throw.h | 8 |
2 files changed, 9 insertions, 4 deletions
diff --git a/include/mruby/irep.h b/include/mruby/irep.h index 78cbc2b74..027a294d5 100644 --- a/include/mruby/irep.h +++ b/include/mruby/irep.h @@ -48,8 +48,13 @@ typedef struct mrb_irep { #define MRB_ISEQ_NO_FREE 1 MRB_API mrb_irep *mrb_add_irep(mrb_state *mrb); + +/* @param [const uint8_t*] irep code, expected as a literal */ MRB_API mrb_value mrb_load_irep(mrb_state*, const uint8_t*); + +/* @param [const uint8_t*] irep code, expected as a literal */ MRB_API mrb_value mrb_load_irep_cxt(mrb_state*, const uint8_t*, mrbc_context*); + void mrb_irep_free(mrb_state*, struct mrb_irep*); void mrb_irep_incref(mrb_state*, struct mrb_irep*); void mrb_irep_decref(mrb_state*, struct mrb_irep*); diff --git a/include/mruby/throw.h b/include/mruby/throw.h index 5d3d214e7..4a1fd8d60 100644 --- a/include/mruby/throw.h +++ b/include/mruby/throw.h @@ -15,9 +15,9 @@ #if defined(MRB_ENABLE_CXX_EXCEPTION) && defined(__cplusplus) -#define MRB_TRY(buf) do { try { +#define MRB_TRY(buf) try { #define MRB_CATCH(buf) } catch(mrb_jmpbuf_impl e) { if (e != (buf)->impl) { throw e; } -#define MRB_END_EXC(buf) } } while(0) +#define MRB_END_EXC(buf) } #define MRB_THROW(buf) throw((buf)->impl) typedef mrb_int mrb_jmpbuf_impl; @@ -34,9 +34,9 @@ typedef mrb_int mrb_jmpbuf_impl; #define MRB_LONGJMP longjmp #endif -#define MRB_TRY(buf) do { if (MRB_SETJMP((buf)->impl) == 0) { +#define MRB_TRY(buf) if (MRB_SETJMP((buf)->impl) == 0) { #define MRB_CATCH(buf) } else { -#define MRB_END_EXC(buf) } } while(0) +#define MRB_END_EXC(buf) } #define MRB_THROW(buf) MRB_LONGJMP((buf)->impl, 1); #define mrb_jmpbuf_impl jmp_buf |
