Skip to content

Commit

Permalink
C doesn't have try-catch
Browse files Browse the repository at this point in the history
  • Loading branch information
kjunichi committed Jul 7, 2016
1 parent 0d9aa83 commit f67631a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/mruby/throw.h
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit f67631a

Please sign in to comment.