From 00e61212600c53e9c4f1629a6e3bcb93422417c2 Mon Sep 17 00:00:00 2001 From: Tomasz Dąbrowski Date: Tue, 22 Nov 2016 13:22:02 +0100 Subject: Safeguard against trying to use C++ exception handling in C code --- include/mruby/throw.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/mruby/throw.h b/include/mruby/throw.h index 5dd1d0a9f..010793027 100644 --- a/include/mruby/throw.h +++ b/include/mruby/throw.h @@ -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 { -- cgit v1.2.3