From 0bac3d0b386d6e9cc85865072b85889f581c2651 Mon Sep 17 00:00:00 2001 From: Rudi Heitbaum Date: Sun, 20 Mar 2022 11:33:12 +0000 Subject: [PATCH] p7zip: patch to support C++17 compiler --- ...nge-numMethods-from-bool-to-unsigned.patch | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 packages/compress/p7zip/patches/p7zip-0501-change-numMethods-from-bool-to-unsigned.patch diff --git a/packages/compress/p7zip/patches/p7zip-0501-change-numMethods-from-bool-to-unsigned.patch b/packages/compress/p7zip/patches/p7zip-0501-change-numMethods-from-bool-to-unsigned.patch new file mode 100644 index 0000000000..93eb0588c0 --- /dev/null +++ b/packages/compress/p7zip/patches/p7zip-0501-change-numMethods-from-bool-to-unsigned.patch @@ -0,0 +1,34 @@ +From 0820ef4b9238c1e39ae5bda32cc08cce3fd3ce89 Mon Sep 17 00:00:00 2001 +From: Nisha Parrakat +Date: Wed, 26 May 2021 19:59:28 +0000 +Subject: [PATCH] fixes the below error + +| ../../../../CPP/7zip/Archive/Wim/WimHandler.cpp: In member function 'virtual LONG NArchive::NWim::CHandler::GetArchiveProperty(PROPID, PROPVARIANT*)': +| ../../../../CPP/7zip/Archive/Wim/WimHandler.cpp:308:11: error: use of an operand of type 'bool' in 'operator++' is forbidden in C++17 +| 308 | numMethods++; +| | ^~~~~~~~~~ +| ../../../../CPP/7zip/Archive/Wim/WimHandler.cpp:318:9: error: use of an operand of type 'bool' in 'operator++' is forbidden in C++17 +| 318 | numMethods++; + +use unsigned instead of bool +Signed-off-by: Nisha Parrakat + +Upstream-Status: Pending + +--- + CPP/7zip/Archive/Wim/WimHandler.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/CPP/7zip/Archive/Wim/WimHandler.cpp b/CPP/7zip/Archive/Wim/WimHandler.cpp +index 27d3298..4ff5cfe 100644 +--- a/CPP/7zip/Archive/Wim/WimHandler.cpp ++++ b/CPP/7zip/Archive/Wim/WimHandler.cpp +@@ -298,7 +298,7 @@ STDMETHODIMP CHandler::GetArchiveProperty(PROPID propID, PROPVARIANT *value) + + AString res; + +- bool numMethods = 0; ++ unsigned numMethods = 0; + for (unsigned i = 0; i < ARRAY_SIZE(k_Methods); i++) + { + if (methodMask & ((UInt32)1 << i))