summaryrefslogtreecommitdiff
path: root/config_int.h
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2023-01-16 21:53:31 -0500
committerGitHub <noreply@github.com>2023-01-16 21:53:31 -0500
commit524e99f2190197151aa3f7406bc6f39b85e5d12c (patch)
treeeb9836fd14215ef739ffdeb1c70c51ca704c42e2 /config_int.h
parentf0202c369ede549aa2d60e483b93c01c62ad400d (diff)
downloadcryptopp-git-524e99f2190197151aa3f7406bc6f39b85e5d12c.tar.gz
Fix unused variable declared as const under VS2022, v17.4 (GH #1185) (PR #1186)
Fix unused variable declared as const under VS2022, v17.4
Diffstat (limited to 'config_int.h')
-rw-r--r--config_int.h21
1 files changed, 18 insertions, 3 deletions
diff --git a/config_int.h b/config_int.h
index 2f74480f..d71c08ef 100644
--- a/config_int.h
+++ b/config_int.h
@@ -27,6 +27,16 @@
#include "config_ns.h"
#include "config_ver.h"
+#include "config_misc.h"
+
+// C5264 new for VS2022/v17.4, MSC v14.34
+// https://github.com/weidai11/cryptopp/issues/1185
+#if (CRYPTOPP_MSC_VERSION)
+# pragma warning(push)
+# if (CRYPTOPP_MSC_VERSION >= 1434)
+# pragma warning(disable: 5264)
+# endif
+#endif
/// \brief Library byte guard
/// \details CRYPTOPP_NO_GLOBAL_BYTE indicates <tt>byte</tt> is in the Crypto++
@@ -161,7 +171,7 @@ typedef word64 lword;
/// \details LWORD_MAX is the maximum value for large word types.
/// Since an <tt>lword</tt> is an unsigned type, the value is
/// <tt>0xffffffffffffffff</tt>. W64LIT will append the proper suffix.
-const lword LWORD_MAX = W64LIT(0xffffffffffffffff);
+CRYPTOPP_CONST_OR_CONSTEXPR lword LWORD_MAX = W64LIT(0xffffffffffffffff);
#if defined(CRYPTOPP_DOXYGEN_PROCESSING)
/// \brief Half word used for multiprecision integer arithmetic
@@ -242,12 +252,17 @@ const lword LWORD_MAX = W64LIT(0xffffffffffffffff);
/// \brief Size of a platform word in bytes
/// \details The size of a platform word, in bytes
-const unsigned int WORD_SIZE = sizeof(word);
+CRYPTOPP_CONST_OR_CONSTEXPR unsigned int WORD_SIZE = sizeof(word);
/// \brief Size of a platform word in bits
/// \details The size of a platform word, in bits
-const unsigned int WORD_BITS = WORD_SIZE * 8;
+/// \sa https://github.com/weidai11/cryptopp/issues/1185
+CRYPTOPP_CONST_OR_CONSTEXPR unsigned int WORD_BITS = WORD_SIZE * 8;
NAMESPACE_END
+#if (CRYPTOPP_MSC_VERSION)
+# pragma warning(pop)
+#endif
+
#endif // CRYPTOPP_CONFIG_INT_H