diff options
author | Jeffrey Walton <noloader@gmail.com> | 2018-02-21 09:59:52 -0500 |
---|---|---|
committer | Jeffrey Walton <noloader@gmail.com> | 2018-02-21 09:59:52 -0500 |
commit | 143f5a307908690f93d86b5f5f885444a2446158 (patch) | |
tree | cf9cf22358eab4f79a1c2edd3bf9e6cc39ca1f95 /algparam.h | |
parent | 59088779d8726cbc564cac6dd122897a5f75de0d (diff) | |
download | cryptopp-git-143f5a307908690f93d86b5f5f885444a2446158.tar.gz |
Handle C++17 std::uncaught_exceptions (GH #590)
Diffstat (limited to 'algparam.h')
-rw-r--r-- | algparam.h | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -3,7 +3,6 @@ /// \file algparam.h
/// \brief Classes for working with NameValuePairs
-
#ifndef CRYPTOPP_ALGPARAM_H
#define CRYPTOPP_ALGPARAM_H
@@ -309,8 +308,11 @@ public: virtual ~AlgorithmParametersBase() CRYPTOPP_THROW
{
-#ifdef CRYPTOPP_UNCAUGHT_EXCEPTION_AVAILABLE
- if (!std::uncaught_exception())
+
+#if defined(CRYPTOPP_CXX17_EXCEPTIONS)
+ if (std::uncaught_exceptions() == 0)
+#elif defined(CRYPTOPP_UNCAUGHT_EXCEPTION_AVAILABLE)
+ if (std::uncaught_exception() == false)
#else
try
#endif
@@ -318,7 +320,7 @@ public: if (m_throwIfNotUsed && !m_used)
throw ParameterNotUsed(m_name);
}
-#ifndef CRYPTOPP_UNCAUGHT_EXCEPTION_AVAILABLE
+#if !defined(CRYPTOPP_CXX17_EXCEPTIONS) && !defined(CRYPTOPP_UNCAUGHT_EXCEPTION_AVAILABLE)
catch(const Exception&)
{
}
|