diff --git a/src/json.hpp b/src/json.hpp index 9fb5fefe5..f9a928202 100644 --- a/src/json.hpp +++ b/src/json.hpp @@ -82,7 +82,7 @@ SOFTWARE. #endif // allow to disable exceptions -#if __cpp_exceptions && not defined(JSON_NOEXCEPTION) +#if (__cpp_exceptions || defined(_CPPUNWIND)) && not defined(JSON_NOEXCEPTION) #define JSON_THROW(exception) throw exception #define JSON_TRY try #define JSON_CATCH(exception) catch(exception) diff --git a/src/json.hpp.re2c b/src/json.hpp.re2c index a837df065..2cad18aa4 100644 --- a/src/json.hpp.re2c +++ b/src/json.hpp.re2c @@ -82,7 +82,7 @@ SOFTWARE. #endif // allow to disable exceptions -#if __cpp_exceptions && not defined(JSON_NOEXCEPTION) +#if (__cpp_exceptions || defined(_CPPUNWIND)) && not defined(JSON_NOEXCEPTION) #define JSON_THROW(exception) throw exception #define JSON_TRY try #define JSON_CATCH(exception) catch(exception)