From a01cae2636f4e664c38ddf8b12f374c448fc0303 Mon Sep 17 00:00:00 2001 From: Riccardo Ressi <104351458+rressi-at-globus@users.noreply.github.com> Date: Sun, 8 Sep 2024 21:05:11 +0200 Subject: [PATCH] [cryptopp] clang-cl: fix compilation with cryptopp/gzip.h (#40679) Co-authored-by: Cheney Wang <38240633+Cheney-W@users.noreply.github.com> --- ports/cryptopp/cryptopp.patch | 26 ++++++++++++++++++++++++++ ports/cryptopp/portfile.cmake | 4 +++- ports/cryptopp/vcpkg.json | 1 + versions/baseline.json | 2 +- versions/c-/cryptopp.json | 5 +++++ 5 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 ports/cryptopp/cryptopp.patch diff --git a/ports/cryptopp/cryptopp.patch b/ports/cryptopp/cryptopp.patch new file mode 100644 index 0000000000..a1f66b4a45 --- /dev/null +++ b/ports/cryptopp/cryptopp.patch @@ -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 struct rebind { typedef AllocatorWithCleanup other; }; +-#if (CRYPTOPP_MSC_VERSION >= 1500) ++#if (CRYPTOPP_MSC_VERSION >= 1500) || defined(__clang__) + AllocatorWithCleanup() {} + template AllocatorWithCleanup(const AllocatorWithCleanup &) {} + #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 diff --git a/ports/cryptopp/portfile.cmake b/ports/cryptopp/portfile.cmake index f68cd038d8..70df01300f 100644 --- a/ports/cryptopp/portfile.cmake +++ b/ports/cryptopp/portfile.cmake @@ -15,7 +15,9 @@ vcpkg_from_github( REF "CRYPTOPP_${CRYPTOPP_VERSION}" SHA512 28a67141155c9c15e3e6a2173b3a8487cc38a2a2ade73bf4a09814ca541be6b06e9a501be26f7e2f42a2f80df21b076aa5d8ad4224dc0a1f8d7f3b24deae465e HEAD_REF master - PATCHES patch.patch + PATCHES + patch.patch + cryptopp.patch ) file(COPY "${CMAKE_SOURCE_PATH}/cryptopp" DESTINATION "${SOURCE_PATH}") diff --git a/ports/cryptopp/vcpkg.json b/ports/cryptopp/vcpkg.json index e3706c6c2f..7dc2c2de6b 100644 --- a/ports/cryptopp/vcpkg.json +++ b/ports/cryptopp/vcpkg.json @@ -1,6 +1,7 @@ { "name": "cryptopp", "version": "8.9.0", + "port-version": 1, "description": "Crypto++ is a free C++ class library of cryptographic schemes.", "homepage": "https://github.com/weidai11/cryptopp", "license": "BSL-1.0", diff --git a/versions/baseline.json b/versions/baseline.json index 584b60f86c..a1349f4bae 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -2046,7 +2046,7 @@ }, "cryptopp": { "baseline": "8.9.0", - "port-version": 0 + "port-version": 1 }, "cserialport": { "baseline": "4.3.1", diff --git a/versions/c-/cryptopp.json b/versions/c-/cryptopp.json index 162b5a68ea..5e3444cf29 100644 --- a/versions/c-/cryptopp.json +++ b/versions/c-/cryptopp.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "d0e6dbcd3cb14acffac5ce963dc8fcd1178101fc", + "version": "8.9.0", + "port-version": 1 + }, { "git-tree": "48788514ae1e84dea9055e603527c91f92c124fb", "version": "8.9.0",