Skip to content

Commit

Permalink
Safeguard against trying to use C++ exception handling in C code
Browse files Browse the repository at this point in the history
  • Loading branch information
dabroz authored and matz committed Nov 24, 2016
1 parent 401ad45 commit 00e6121
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/mruby/throw.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
#ifndef MRB_THROW_H
#define MRB_THROW_H

#if defined(MRB_ENABLE_CXX_EXCEPTION) && !defined(__cplusplus)
#error Trying to use C++ exception handling in C code
#endif

#if defined(MRB_ENABLE_CXX_EXCEPTION) && defined(__cplusplus)

#define MRB_TRY(buf) do { try {
Expand Down

0 comments on commit 00e6121

Please sign in to comment.