diff options
author | Jeffrey Walton <noloader@gmail.com> | 2016-09-06 08:53:55 -0400 |
---|---|---|
committer | Jeffrey Walton <noloader@gmail.com> | 2016-09-06 08:53:55 -0400 |
commit | 9205efda02a788084a332bff06733572a338b132 (patch) | |
tree | 232f78bf5548214d3d3042edf8b50567ebf52f47 /config.h | |
parent | 2a51576adc665121921b56e011ae437cb0d69cfa (diff) | |
download | cryptopp-git-9205efda02a788084a332bff06733572a338b132.tar.gz |
Add constexpr to CRYPTOPP_CONSTANT when CRYPTOPP_CXX11_CONSTEXPR is in effect
Diffstat (limited to 'config.h')
-rw-r--r-- | config.h | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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)
|