Permalink
Browse files

C doesn't have try-catch

  • Loading branch information...
kjunichi committed Jul 7, 2016
1 parent 0d9aa83 commit f67631afb4482eb22c4c626475544676e255ec0f
Showing with 2 additions and 2 deletions.
  1. +2 −2 include/mruby/throw.h
View
@@ -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

0 comments on commit f67631a

Please sign in to comment.