Add constexpr to CRYPTOPP_CONSTANT when CRYPTOPP_CXX11_CONSTEXPR is in effect

pull/131/merge
Jeffrey Walton 2016-09-06 08:53:55 -04:00
parent 2a51576adc
commit 9205efda02
2 changed files with 12 additions and 0 deletions

View File

@ -902,6 +902,12 @@ NAMESPACE_END
# define CRYPTOPP_ALIGN_DATA(x) alignas(x)
#endif // CRYPTOPP_CXX11_ALIGNAS
// Hack... CRYPTOPP_CONSTANT is defined earlier, before C++11 constexpr availability is determined
#if defined(CRYPTOPP_CXX11_CONSTEXPR)
# undef CRYPTOPP_CONSTANT
# define CRYPTOPP_CONSTANT(x) constexpr static int x;
#endif
// OK to comment the following out, but please report it so we can fix it.
// C++17 value taken from http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4567.pdf.
#if (defined(__cplusplus) && (__cplusplus >= 199711L) && (__cplusplus < 201402L)) && !defined(CRYPTOPP_UNCAUGHT_EXCEPTION_AVAILABLE)

View File

@ -902,6 +902,12 @@ NAMESPACE_END
# define CRYPTOPP_ALIGN_DATA(x) alignas(x)
#endif // CRYPTOPP_CXX11_ALIGNAS
// Hack... CRYPTOPP_CONSTANT is defined earlier, before C++11 constexpr availability is determined
#if defined(CRYPTOPP_CXX11_CONSTEXPR)
# undef CRYPTOPP_CONSTANT
# define CRYPTOPP_CONSTANT(x) constexpr static int x;
#endif
// OK to comment the following out, but please report it so we can fix it.
// C++17 value taken from http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4567.pdf.
#if (defined(__cplusplus) && (__cplusplus >= 199711L) && (__cplusplus < 201402L)) && !defined(CRYPTOPP_UNCAUGHT_EXCEPTION_AVAILABLE)