🏁 added check for _CPPUNWIND

MSVC does not define __cpp_exceptions, but seems to use _CPPUNWIND when
exception support is switched on, see
https://msdn.microsoft.com/en-us/library/b0084kay.aspx.
This commit is contained in:
Niels Lohmann 2017-03-11 17:59:24 +01:00
parent 65dfc97d40
commit e3e6cbecc7
No known key found for this signature in database
GPG key ID: 7F3CEA63AE251B69
2 changed files with 2 additions and 2 deletions

View file

@ -82,7 +82,7 @@ SOFTWARE.
#endif #endif
// allow to disable exceptions // 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_THROW(exception) throw exception
#define JSON_TRY try #define JSON_TRY try
#define JSON_CATCH(exception) catch(exception) #define JSON_CATCH(exception) catch(exception)

View file

@ -82,7 +82,7 @@ SOFTWARE.
#endif #endif
// allow to disable exceptions // 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_THROW(exception) throw exception
#define JSON_TRY try #define JSON_TRY try
#define JSON_CATCH(exception) catch(exception) #define JSON_CATCH(exception) catch(exception)