summaryrefslogtreecommitdiff
path: root/config_cxx.h
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2020-11-30 17:59:07 -0500
committerJeffrey Walton <noloader@gmail.com>2020-11-30 17:59:07 -0500
commitaa4cf301b4e5db9e414ba00a27779f5910c42a9e (patch)
treee0c2d9d5598e4f61ae7de9b355cbd83350617ab7 /config_cxx.h
parent6f1aa13d22897330a0a53e1ff5fcade12c82d042 (diff)
downloadcryptopp-git-aa4cf301b4e5db9e414ba00a27779f5910c42a9e.tar.gz
Tighten test for CRYPTOPP_CXX17_UNCAUGHT_EXCEPTIONS (GH #980)
Formerly we were just testing for __cpp_lib_uncaught_exceptions. Now we test for __cpp_lib_uncaught_exceptions >= 201411L
Diffstat (limited to 'config_cxx.h')
-rw-r--r--config_cxx.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/config_cxx.h b/config_cxx.h
index 300454da..23f7640c 100644
--- a/config_cxx.h
+++ b/config_cxx.h
@@ -215,14 +215,17 @@
// C++17 uncaught_exceptions: MS at VS2015 (19.00); GCC at 6.0; Clang at 3.5; Intel 18.0.
// Clang and __EXCEPTIONS see http://releases.llvm.org/3.6.0/tools/clang/docs/ReleaseNotes.html
+// Also see https://github.com/weidai11/cryptopp/issues/980. I'm not sure what
+// to do when the compiler defines __cpp_lib_uncaught_exceptions but the platform
+// does not support std::uncaught_exceptions. What was Apple thinking???
#if defined(__clang__)
# if __EXCEPTIONS && __has_feature(cxx_exceptions)
-# if __cpp_lib_uncaught_exceptions
+# if __cpp_lib_uncaught_exceptions >= 201411L
# define CRYPTOPP_CXX17_UNCAUGHT_EXCEPTIONS 1
# endif
# endif
#elif (CRYPTOPP_MSC_VERSION >= 1900) || (__INTEL_COMPILER >= 1800) || \
- (CRYPTOPP_GCC_VERSION >= 60000) || (__cpp_lib_uncaught_exceptions)
+ (CRYPTOPP_GCC_VERSION >= 60000) || (__cpp_lib_uncaught_exceptions >= 201411L)
# define CRYPTOPP_CXX17_UNCAUGHT_EXCEPTIONS 1
#endif // uncaught_exceptions compilers