summaryrefslogtreecommitdiff
path: root/config_cxx.h
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2021-03-20 16:07:53 -0400
committerJeffrey Walton <noloader@gmail.com>2021-03-20 16:07:53 -0400
commitf845316e9586423bc1b399267be2c882d0f3844e (patch)
treebda1dab884e7069c6588afd592d68751c38bab21 /config_cxx.h
parenta3224bf4453147438d73d2959bdfe7aeab41ddb0 (diff)
downloadcryptopp-git-f845316e9586423bc1b399267be2c882d0f3844e.tar.gz
Cleanup C++11 compile when CRYPTOPP_NO_CXX11 is in effect
Diffstat (limited to 'config_cxx.h')
-rw-r--r--config_cxx.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/config_cxx.h b/config_cxx.h
index 7afa0759..62c17c4d 100644
--- a/config_cxx.h
+++ b/config_cxx.h
@@ -241,7 +241,14 @@
// ***************** C++ fixups ********************
-#if defined(CRYPTOPP_CXX11_NOEXCEPT)
+// Testing with -DCRYPTOPP_NO_CXX11 causes a lot of noise
+// Grab this one C++11 feature for a sane compile.
+#if (CRYPTOPP_MSC_VERSION >= 1900) || __has_feature(cxx_noexcept) || \
+ (__INTEL_COMPILER >= 1400) || (CRYPTOPP_GCC_VERSION >= 40600) || (__SUNPRO_CC >= 0x5130)
+# define CRYPTOPP_CXX11_ALT_NOEXCEPT 1
+#endif // noexcept compilers
+
+#if defined(CRYPTOPP_CXX11_NOEXCEPT) || defined(CRYPTOPP_CXX11_ALT_NOEXCEPT)
# define CRYPTOPP_THROW noexcept(false)
# define CRYPTOPP_NO_THROW noexcept(true)
#else