summaryrefslogtreecommitdiff
path: root/algparam.h
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2018-02-21 09:59:52 -0500
committerJeffrey Walton <noloader@gmail.com>2018-02-21 09:59:52 -0500
commit143f5a307908690f93d86b5f5f885444a2446158 (patch)
treecf9cf22358eab4f79a1c2edd3bf9e6cc39ca1f95 /algparam.h
parent59088779d8726cbc564cac6dd122897a5f75de0d (diff)
downloadcryptopp-git-143f5a307908690f93d86b5f5f885444a2446158.tar.gz
Handle C++17 std::uncaught_exceptions (GH #590)
Diffstat (limited to 'algparam.h')
-rw-r--r--algparam.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/algparam.h b/algparam.h
index 09c4b8cd..4870f59e 100644
--- a/algparam.h
+++ b/algparam.h
@@ -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&)
{
}