From d4fc80a66be91daaa6d2402c25099c6d63911243cbe6394c4d3800e2d2d22232 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Thu, 26 Mar 2015 10:20:59 +0000 Subject: [PATCH] Add order.diff OBS-URL: https://build.opensuse.org/package/show/windows:mingw:win32/mingw32-headers?expand=0&rev=30 --- mingw32-headers.changes | 6 ++++++ mingw32-headers.spec | 2 ++ order.diff | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 order.diff diff --git a/mingw32-headers.changes b/mingw32-headers.changes index c0608aa..ed66274 100644 --- a/mingw32-headers.changes +++ b/mingw32-headers.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Mar 26 10:19:04 UTC 2015 - jengelh@inai.de + +- Add order.diff to fix SHGetFolderPathW compile errors in code + using shlobj.h. + ------------------------------------------------------------------- Wed Mar 25 10:48:30 UTC 2015 - jengelh@inai.de diff --git a/mingw32-headers.spec b/mingw32-headers.spec index c91d212..6969439 100644 --- a/mingw32-headers.spec +++ b/mingw32-headers.spec @@ -27,6 +27,7 @@ Url: http://mingw-w64.sf.net/ #DL-URL: http://downloads.sf.net/mingw-w64/mingw-w64-%version.tar.bz2 Source: mingw-w64-headers-%version.tar.xz Source9: %name-rpmlintrc +Patch1: order.diff BuildRequires: mingw32-filesystem BuildRequires: xz #!BuildIgnore: post-build-checks @@ -53,6 +54,7 @@ an actual pthread implementation (like winpthreads) is installed. %prep %setup -q -n mingw-w64-headers +%patch -P 1 -p1 %build %{_mingw32_configure} \ diff --git a/order.diff b/order.diff new file mode 100644 index 0000000..edc3896 --- /dev/null +++ b/order.diff @@ -0,0 +1,36 @@ +From: Jan Engelhardt +Date: 2015-03-26 10:55:28.730890877 +0100 + +In downstream packages, gcc emits: + CC master.o + In file included from master.c:48:0: + /usr/x86_64-w64-mingw32/sys-root/mingw/include/shlobj.h:37:3: error: unknown type name 'EXTERN_C' + SHFOLDERAPI SHGetFolderPathW (HWND hwnd, int csidl, HANDLE hToken, DWORD dwFlags, LPWSTR pszPath); + +SHLFOLDERAPI is defined to expand to something with EXTERN_C, +however, EXTERN_C is not defined at the time of SHGetFolderPathW +declaration. +--- + include/shlobj.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Index: mingw-w64-headers/include/shlobj.h +=================================================================== +--- mingw-w64-headers.orig/include/shlobj.h ++++ mingw-w64-headers/include/shlobj.h +@@ -34,7 +34,6 @@ typedef enum { + SHGFP_TYPE_DEFAULT = 1, + } SHGFP_TYPE; + +- SHFOLDERAPI SHGetFolderPathW (HWND hwnd, int csidl, HANDLE hToken, DWORD dwFlags, LPWSTR pszPath); + + #endif + +@@ -718,6 +717,7 @@ extern "C" { + SHSTDAPI_(void) SHFlushSFCache (void); + + SHFOLDERAPI SHGetFolderPathA (HWND hwnd, int csidl, HANDLE hToken, DWORD dwFlags, LPSTR pszPath); ++ SHFOLDERAPI SHGetFolderPathW (HWND hwnd, int csidl, HANDLE hToken, DWORD dwFlags, LPWSTR pszPath); + SHSTDAPI SHGetFolderLocation (HWND hwnd, int csidl, HANDLE hToken, DWORD dwFlags, PIDLIST_ABSOLUTE *ppidl); + SHSTDAPI SHSetFolderPathA (int csidl, HANDLE hToken, DWORD dwFlags, LPCSTR pszPath); + SHSTDAPI SHSetFolderPathW (int csidl, HANDLE hToken, DWORD dwFlags, LPCWSTR pszPath);