aboutsummaryrefslogtreecommitdiff
path: root/archivers/p7zip
diff options
context:
space:
mode:
authorRaphael Kubo da Costa <rakuco@FreeBSD.org>2018-01-05 21:45:13 +0000
committerRaphael Kubo da Costa <rakuco@FreeBSD.org>2018-01-05 21:45:13 +0000
commit191e95b34018db78a5bae320ed78a639e1a23052 (patch)
tree1028f897a5c0071bca1748b352763eb14a536808 /archivers/p7zip
parent959feda6155d3d2c92779abd79750620d8aff3ca (diff)
downloadports-191e95b34018db78a5bae320ed78a639e1a23052.tar.gz
ports-191e95b34018db78a5bae320ed78a639e1a23052.zip
Add a patch to fix the build with Clang 6.0.
../../../../CPP/Windows/ErrorMsg.cpp:24:10: error: case value evaluates to -2147024809, which cannot be narrowed to type 'DWORD' (aka 'unsigned int') [-Wc++11-narrowing] case E_INVALIDARG : txt = "E_INVALIDARG"; break ; ^ ../../../../CPP/Common/MyWindows.h:89:22: note: expanded from macro 'E_INVALIDARG' #define E_INVALIDARG ((HRESULT)0x80070057L) ^ HRESULT causes the macro to be parsed as a signed long, so we need to force it to be checked as an unsigned long instead. PR: 224930
Notes
Notes: svn path=/head/; revision=458172
Diffstat (limited to 'archivers/p7zip')
-rw-r--r--archivers/p7zip/files/patch-CPP_Windows_ErrorMsg.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/archivers/p7zip/files/patch-CPP_Windows_ErrorMsg.cpp b/archivers/p7zip/files/patch-CPP_Windows_ErrorMsg.cpp
new file mode 100644
index 000000000000..71de3e9f59c8
--- /dev/null
+++ b/archivers/p7zip/files/patch-CPP_Windows_ErrorMsg.cpp
@@ -0,0 +1,33 @@
+This fixes the build with Clang 6.0:
+
+ ../../../../CPP/Windows/ErrorMsg.cpp:24:10: error: case value evaluates to -2147024809, which cannot be narrowed to type 'DWORD' (aka 'unsigned int') [-Wc++11-narrowing]
+ case E_INVALIDARG : txt = "E_INVALIDARG"; break ;
+ ^
+ ../../../../CPP/Common/MyWindows.h:89:22: note: expanded from macro 'E_INVALIDARG'
+ #define E_INVALIDARG ((HRESULT)0x80070057L)
+ ^
+
+The HRESULT cast in the macro causes the value to be read as signed int.
+--- CPP/Windows/ErrorMsg.cpp.orig 2015-01-18 18:20:28 UTC
++++ CPP/Windows/ErrorMsg.cpp
+@@ -15,13 +15,13 @@ UString MyFormatMessage(DWORD errorCode)
+
+ switch(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 ;
+- case E_ABORT : txt = "E_ABORT"; break ;
+- case E_FAIL : txt = "E_FAIL"; break ;
+- case STG_E_INVALIDFUNCTION : txt = "STG_E_INVALIDFUNCTION"; break ;
+- case E_OUTOFMEMORY : txt = "E_OUTOFMEMORY"; break ;
+- case E_INVALIDARG : txt = "E_INVALIDARG"; break ;
++ case (DWORD)(E_NOTIMPL) : txt = "E_NOTIMPL"; break ;
++ case (DWORD)(E_NOINTERFACE) : txt = "E_NOINTERFACE"; break ;
++ case (DWORD)(E_ABORT) : txt = "E_ABORT"; break ;
++ case (DWORD)(E_FAIL) : txt = "E_FAIL"; break ;
++ case (DWORD)(STG_E_INVALIDFUNCTION) : txt = "STG_E_INVALIDFUNCTION"; break ;
++ case (DWORD)(E_OUTOFMEMORY) : txt = "E_OUTOFMEMORY"; break ;
++ case (DWORD)(E_INVALIDARG) : txt = "E_INVALIDARG"; break ;
+ case ERROR_DIRECTORY : txt = "Error Directory"; break ;
+ default:
+ txt = strerror(errorCode);