Commit 2e74a931 authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto Committed by GitHub

Merge pull request #3171 from kjunichi/c-has-no-try

C doesn't have try-catch
parents 0d9aa830 f67631af
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment