FYI...

I've been trying to run concurrent threads to see where folks are on the issue.

We can't change behaviors yet, like not throwing ParameterNotUsed, or
catching "...". That will be addressed when we can perform a major
version bump.

Jeff

---------- Forwarded message ----------
From: Jeffrey Walton <[email protected]>
Date: Sun, Jul 26, 2015 at 7:10 PM
Subject: AlgorithmParameters and noexcept patch
To: <Crypto++ Primaries>

The patch below adds a CRYPTOPP_CXX11 in config.h. I plan on using
CRYPTOPP_CXX11 for move semantics, too (to speed up Integers and
SecBlocks). Then, the defines CRYTPOPP_THROW and CRYTPOPP_NO_THROW.

It does not address the other open questions, like should we catch
std::exception.

Open question: shpuld CRYTPOPP_THROW and CRYTPOPP_NO_THROW be placed
in config.h, misc.h, or somewhere else?

Any comments or objections to the patch? If not, I'll expedite the
check-in for folks who need it.

Jeff

**********

diff --git a/algparam.h b/algparam.h
index af853c1..09e26fd 100644
--- a/algparam.h
+++ b/algparam.h
@@ -259,7 +259,7 @@ public:
        AlgorithmParametersBase(const char *name, bool throwIfNotUsed)
                : m_name(name), m_throwIfNotUsed(throwIfNotUsed),
m_used(false) {}

-       virtual ~AlgorithmParametersBase()
+       virtual ~AlgorithmParametersBase() CRYTPOPP_THROW
        {
 #ifdef CRYPTOPP_UNCAUGHT_EXCEPTION_AVAILABLE
                if (!std::uncaught_exception())
diff --git a/config.h b/config.h
index 7d8bda3..9fe46bb 100644
--- a/config.h
+++ b/config.h
@@ -119,7 +119,25 @@
 #      define __USE_W32_SOCKETS
 #endif

+// Visual Studio and C++11 language features. It looks like the
earliest is Visual Studio 2012.
+// https://msdn.microsoft.com/en-us/library/hh567368%28v=vs.110%29.aspx
+#if defined(_MSC_VER) && (_MSC_VER >= 1500)
+# define CRYPTOPP_CXX11
+#endif
+
+// C++11 added noexcept, but MS did not adopt until VS2015
+#if defined(CRYPTOPP_CXX11)
+# if (_MSC_VER >= 1700)
+#  define CRYTPOPP_THROW noexcept(false)
+#  define CRYTPOPP_NO_THROW noexcept(true)
+# else // Clang, GCC, ICC
+#  define CRYTPOPP_THROW nothrow(false)
+#  define CRYTPOPP_NO_THROW nothrow(true)
+# endif
+#endif
+

-- 
-- 
You received this message because you are subscribed to the "Crypto++ Users" 
Google Group.
To unsubscribe, send an email to [email protected].
More information about Crypto++ and this group is available at 
http://www.cryptopp.com.
--- 
You received this message because you are subscribed to the Google Groups 
"Crypto++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to