Add CRYPTOPP_CXX14 define

pull/867/head
Jeffrey Walton 2019-07-22 01:08:12 -04:00
parent a7f2796dda
commit 9d2cab7548
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
1 changed files with 13 additions and 1 deletions

View File

@ -68,8 +68,15 @@
# endif # endif
#endif #endif
// C++14 macro version, https://stackoverflow.com/q/26089319/608639
#if defined(CRYPTOPP_CXX11) && !defined(CRYPTOPP_NO_CXX14)
# if ((_MSC_VER >= 1900) || (__cplusplus >= 201402L)) && !defined(_STLPORT_VERSION)
# define CRYPTOPP_CXX14 1
# endif
#endif
// C++17 macro version, https://stackoverflow.com/q/38456127/608639 // C++17 macro version, https://stackoverflow.com/q/38456127/608639
#if defined(CRYPTOPP_CXX11) && !defined(CRYPTOPP_NO_CXX17) #if defined(CRYPTOPP_CXX14) && !defined(CRYPTOPP_NO_CXX17)
# if ((_MSC_VER >= 1900) || (__cplusplus >= 201703L)) && !defined(_STLPORT_VERSION) # if ((_MSC_VER >= 1900) || (__cplusplus >= 201703L)) && !defined(_STLPORT_VERSION)
# define CRYPTOPP_CXX17 1 # define CRYPTOPP_CXX17 1
# endif # endif
@ -176,11 +183,16 @@
// ***************** C++14 and above ******************** // ***************** C++14 and above ********************
#if defined(CRYPTOPP_CXX14)
// Extended static_assert with one argument // Extended static_assert with one argument
// Microsoft cannot handle the single argument static_assert as of VS2019 (cl.exe 19.00)
#if (__cpp_static_assert >= 201411) #if (__cpp_static_assert >= 201411)
# define CRYPTOPP_CXX14_STATIC_ASSERT 1 # define CRYPTOPP_CXX14_STATIC_ASSERT 1
#endif // static_assert #endif // static_assert
#endif
// ***************** C++17 and above ******************** // ***************** C++17 and above ********************
// C++17 is available // C++17 is available