diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2016-07-08 12:14:46 +0900 |
|---|---|---|
| committer | GitHub <[email protected]> | 2016-07-08 12:14:46 +0900 |
| commit | 2e74a931121be3c1dbb030338527d301fec4d33f (patch) | |
| tree | f9d86b549cdfaa0ca9b69a075d48dc688b60c258 /include | |
| parent | 0d9aa830aa7bc7c1fd79c46085d21b1286e66993 (diff) | |
| parent | f67631afb4482eb22c4c626475544676e255ec0f (diff) | |
| download | mruby-2e74a931121be3c1dbb030338527d301fec4d33f.tar.gz mruby-2e74a931121be3c1dbb030338527d301fec4d33f.zip | |
Merge pull request #3171 from kjunichi/c-has-no-try
C doesn't have try-catch
Diffstat (limited to 'include')
| -rw-r--r-- | include/mruby/throw.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/mruby/throw.h b/include/mruby/throw.h index e4b0f1f2b..5dd1d0a9f 100644 --- a/include/mruby/throw.h +++ b/include/mruby/throw.h @@ -7,7 +7,7 @@ #ifndef MRB_THROW_H #define MRB_THROW_H -#ifdef MRB_ENABLE_CXX_EXCEPTION +#if defined(MRB_ENABLE_CXX_EXCEPTION) && defined(__cplusplus) #define MRB_TRY(buf) do { try { #define MRB_CATCH(buf) } catch(mrb_jmpbuf_impl e) { if (e != (buf)->impl) { throw e; } @@ -40,7 +40,7 @@ typedef mrb_int mrb_jmpbuf_impl; struct mrb_jmpbuf { mrb_jmpbuf_impl impl; -#ifdef MRB_ENABLE_CXX_EXCEPTION +#if defined(MRB_ENABLE_CXX_EXCEPTION) && defined(__cplusplus) static mrb_int jmpbuf_id; mrb_jmpbuf() : impl(jmpbuf_id++) {} #endif |
