[cryptopp] clang-cl: fix compilation with cryptopp/gzip.h (#40679)

Co-authored-by: Cheney Wang <38240633+Cheney-W@users.noreply.github.com>
This commit is contained in:
Riccardo Ressi 2024-09-08 21:05:11 +02:00 committed by GitHub
parent 15958906f3
commit a01cae2636
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 36 additions and 2 deletions

View File

@ -0,0 +1,26 @@
diff --git a/secblock.h b/secblock.h
index 5ab920f9..74d939cf 100644
--- a/secblock.h
+++ b/secblock.h
@@ -270,7 +270,7 @@ public:
/// \details VS.NET STL enforces the policy of "All STL-compliant allocators
/// have to provide a template class member called rebind".
template <class V> struct rebind { typedef AllocatorWithCleanup<V, T_Align16> other; };
-#if (CRYPTOPP_MSC_VERSION >= 1500)
+#if (CRYPTOPP_MSC_VERSION >= 1500) || defined(__clang__)
AllocatorWithCleanup() {}
template <class V, bool A> AllocatorWithCleanup(const AllocatorWithCleanup<V, A> &) {}
#endif
diff --git a/zdeflate.cpp b/zdeflate.cpp
index b3514b55..20717c24 100644
--- a/zdeflate.cpp
+++ b/zdeflate.cpp
@@ -413,7 +413,7 @@ unsigned int Deflator::LongestMatch(unsigned int &bestMatch) const
{
CRYPTOPP_ASSERT(scan[2] == match[2]);
unsigned int len = (unsigned int)(
-#if defined(_STDEXT_BEGIN) && !(defined(CRYPTOPP_MSC_VERSION) && (CRYPTOPP_MSC_VERSION < 1400 || CRYPTOPP_MSC_VERSION >= 1600)) && !defined(_STLPORT_VERSION)
+#if defined(_STDEXT_BEGIN) && !(defined(CRYPTOPP_MSC_VERSION) && (CRYPTOPP_MSC_VERSION < 1400 || CRYPTOPP_MSC_VERSION >= 1600)) && !defined(_STLPORT_VERSION) && !defined(__clang__)
stdext::unchecked_mismatch
#else
std::mismatch

View File

@ -15,7 +15,9 @@ vcpkg_from_github(
REF "CRYPTOPP_${CRYPTOPP_VERSION}" REF "CRYPTOPP_${CRYPTOPP_VERSION}"
SHA512 28a67141155c9c15e3e6a2173b3a8487cc38a2a2ade73bf4a09814ca541be6b06e9a501be26f7e2f42a2f80df21b076aa5d8ad4224dc0a1f8d7f3b24deae465e SHA512 28a67141155c9c15e3e6a2173b3a8487cc38a2a2ade73bf4a09814ca541be6b06e9a501be26f7e2f42a2f80df21b076aa5d8ad4224dc0a1f8d7f3b24deae465e
HEAD_REF master HEAD_REF master
PATCHES patch.patch PATCHES
patch.patch
cryptopp.patch
) )
file(COPY "${CMAKE_SOURCE_PATH}/cryptopp" DESTINATION "${SOURCE_PATH}") file(COPY "${CMAKE_SOURCE_PATH}/cryptopp" DESTINATION "${SOURCE_PATH}")

View File

@ -1,6 +1,7 @@
{ {
"name": "cryptopp", "name": "cryptopp",
"version": "8.9.0", "version": "8.9.0",
"port-version": 1,
"description": "Crypto++ is a free C++ class library of cryptographic schemes.", "description": "Crypto++ is a free C++ class library of cryptographic schemes.",
"homepage": "https://github.com/weidai11/cryptopp", "homepage": "https://github.com/weidai11/cryptopp",
"license": "BSL-1.0", "license": "BSL-1.0",

View File

@ -2046,7 +2046,7 @@
}, },
"cryptopp": { "cryptopp": {
"baseline": "8.9.0", "baseline": "8.9.0",
"port-version": 0 "port-version": 1
}, },
"cserialport": { "cserialport": {
"baseline": "4.3.1", "baseline": "4.3.1",

View File

@ -1,5 +1,10 @@
{ {
"versions": [ "versions": [
{
"git-tree": "d0e6dbcd3cb14acffac5ce963dc8fcd1178101fc",
"version": "8.9.0",
"port-version": 1
},
{ {
"git-tree": "48788514ae1e84dea9055e603527c91f92c124fb", "git-tree": "48788514ae1e84dea9055e603527c91f92c124fb",
"version": "8.9.0", "version": "8.9.0",