diff options
author | Jeffrey Walton <noloader@gmail.com> | 2019-07-06 07:03:26 -0400 |
---|---|---|
committer | Jeffrey Walton <noloader@gmail.com> | 2019-07-06 07:03:26 -0400 |
commit | 37de652635a056d51321a6cbedb83ac73b4559d5 (patch) | |
tree | 3cc8af0e2f72a05a2d87c738634198a4610c2d7f /config_cxx.h | |
parent | 76fa704cbed5b16071d6fe73f49f44381ba5c7c0 (diff) | |
download | cryptopp-git-37de652635a056d51321a6cbedb83ac73b4559d5.tar.gz |
Use C++ feature test macros when available
There are not too many of them. __cpp_threadsafe_static_init may be useful for less frequently used compilers and platforms.
Diffstat (limited to 'config_cxx.h')
-rw-r--r-- | config_cxx.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/config_cxx.h b/config_cxx.h index d58f945f..2c5398b9 100644 --- a/config_cxx.h +++ b/config_cxx.h @@ -91,7 +91,8 @@ // MS at VS2015 with Vista (19.00); GCC at 4.3; LLVM Clang at 2.9; Apple Clang at 4.0; Intel 11.1; SunCC 5.13.
// Microsoft's implementation only works for Vista and above, so its further
// limited. http://connect.microsoft.com/VisualStudio/feedback/details/1789709
-#if (CRYPTOPP_MSC_VERSION >= 1900) && ((WINVER >= 0x0600) || (_WIN32_WINNT >= 0x0600)) || \
+#if (__cpp_threadsafe_static_init >= 200806) || \
+ (CRYPTOPP_MSC_VERSION >= 1900) && ((WINVER >= 0x0600) || (_WIN32_WINNT >= 0x0600)) || \
(CRYPTOPP_LLVM_CLANG_VERSION >= 20900) || (CRYPTOPP_APPLE_CLANG_VERSION >= 40000) || \
(__INTEL_COMPILER >= 1110) || (CRYPTOPP_GCC_VERSION >= 40300) || (__SUNPRO_CC >= 0x5130)
# define CRYPTOPP_CXX11_DYNAMIC_INIT 1
@@ -129,15 +130,17 @@ #endif // noexcept compilers
// variadic templates: MS at VS2013 (18.00); GCC at 4.3; Clang at 2.9; Intel 12.1; SunCC 5.13.
-#if (CRYPTOPP_MSC_VERSION >= 1800) || __has_feature(cxx_variadic_templates) || \
- (__INTEL_COMPILER >= 1210) || (CRYPTOPP_GCC_VERSION >= 40300) || (__SUNPRO_CC >= 0x5130)
+#if (__cpp_variadic_templates >= 200704) || __has_feature(cxx_variadic_templates) \
+ (CRYPTOPP_MSC_VERSION >= 1800) || (__INTEL_COMPILER >= 1210) || \
+ (CRYPTOPP_GCC_VERSION >= 40300) || (__SUNPRO_CC >= 0x5130)
# define CRYPTOPP_CXX11_VARIADIC_TEMPLATES 1
#endif // variadic templates
// constexpr: MS at VS2015 (19.00); GCC at 4.6; Clang at 3.1; Intel 16.0; SunCC 5.13.
// Intel has mis-supported the feature since at least ICPC 13.00
-#if (CRYPTOPP_MSC_VERSION >= 1900) || __has_feature(cxx_constexpr) || \
- (__INTEL_COMPILER >= 1600) || (CRYPTOPP_GCC_VERSION >= 40600) || (__SUNPRO_CC >= 0x5130)
+#if (__cpp_constexpr >= 200704) || __has_feature(cxx_constexpr) || \
+ (CRYPTOPP_MSC_VERSION >= 1900) || (__INTEL_COMPILER >= 1600) || \
+ (CRYPTOPP_GCC_VERSION >= 40600) || (__SUNPRO_CC >= 0x5130)
# define CRYPTOPP_CXX11_CONSTEXPR 1
#endif // constexpr compilers
|