p7zip: fix build on gcc10

This commit is contained in:
Lucas Ransan 2020-12-21 19:01:38 +01:00 committed by Frederik Rietdijk
parent 1c89832fd5
commit 7fd60b3c97
2 changed files with 44 additions and 0 deletions

View file

@ -13,6 +13,10 @@ stdenv.mkDerivation rec {
}
;
patches = [
./gcc10.patch
];
# Default makefile is full of impurities on Darwin. The patch doesn't hurt Linux so I'm leaving it unconditional
postPatch = ''
sed -i '/CC=\/usr/d' makefile.macosx_llvm_64bits

View file

@ -0,0 +1,40 @@
From 1b7d2c73f01b2d2b6a3d2d16840e96e92afdcd61 Mon Sep 17 00:00:00 2001
From: jinfeihan57 <jinfeihan57@gmail.com>
Date: Tue, 9 Jun 2020 16:48:25 +0800
Subject: [PATCH] gix gcc10 compiler error
---
CPP/Windows/ErrorMsg.cpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/CPP/Windows/ErrorMsg.cpp b/CPP/Windows/ErrorMsg.cpp
index 99684ae..90a7e20 100644
--- a/CPP/Windows/ErrorMsg.cpp
+++ b/CPP/Windows/ErrorMsg.cpp
@@ -13,7 +13,7 @@ UString MyFormatMessage(DWORD errorCode)
const char * txt = 0;
AString msg;
- switch(errorCode) {
+ switch(HRESULT(errorCode)) {
case ERROR_NO_MORE_FILES : txt = "No more files"; break ;
case E_NOTIMPL : txt = "E_NOTIMPL"; break ;
case E_NOINTERFACE : txt = "E_NOINTERFACE"; break ;
@@ -22,7 +22,7 @@ UString MyFormatMessage(DWORD errorCode)
case STG_E_INVALIDFUNCTION : txt = "STG_E_INVALIDFUNCTION"; break ;
case E_OUTOFMEMORY : txt = "E_OUTOFMEMORY"; break ;
case E_INVALIDARG : txt = "E_INVALIDARG"; break ;
- case ERROR_DIRECTORY : txt = "Error Directory"; break ;
+ case ERROR_DIRECTORY : txt = "Error Directory"; break ;
default:
txt = strerror(errorCode);
}
@@ -43,7 +43,7 @@ bool MyFormatMessage(DWORD messageID, CSysString &message)
const char * txt = 0;
AString msg;
- switch(messageID) {
+ switch(HRESULT(messageID)) {
case ERROR_NO_MORE_FILES : txt = "No more files"; break ;
case E_NOTIMPL : txt = "E_NOTIMPL"; break ;
case E_NOINTERFACE : txt = "E_NOINTERFACE"; break ;