mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
C doesn't have try-catch
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user