summaryrefslogtreecommitdiff
path: root/config.h
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2016-09-06 08:53:55 -0400
committerJeffrey Walton <noloader@gmail.com>2016-09-06 08:53:55 -0400
commit9205efda02a788084a332bff06733572a338b132 (patch)
tree232f78bf5548214d3d3042edf8b50567ebf52f47 /config.h
parent2a51576adc665121921b56e011ae437cb0d69cfa (diff)
downloadcryptopp-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.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/config.h b/config.h
index a25d1430..ab00dc7a 100644
--- a/config.h
+++ b/config.h
@@ -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)