diff options
| author | Junichi Kajiwara <[email protected]> | 2016-07-08 06:30:45 +0900 |
|---|---|---|
| committer | Junichi Kajiwara <[email protected]> | 2016-07-08 06:30:45 +0900 |
| commit | f67631afb4482eb22c4c626475544676e255ec0f (patch) | |
| tree | f9d86b549cdfaa0ca9b69a075d48dc688b60c258 | |
| parent | 0d9aa830aa7bc7c1fd79c46085d21b1286e66993 (diff) | |
| download | mruby-f67631afb4482eb22c4c626475544676e255ec0f.tar.gz mruby-f67631afb4482eb22c4c626475544676e255ec0f.zip | |
C doesn't have try-catch
| -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 |
