headers: Fix compile warning: FindResource redefined
Warning is:
In file included from mingw-w64-headers/include/windows.h:70,
from libsrc/dxerr.c:15,
from libsrc/dxerr8w.c:20:
mingw-w64-headers/include/winbase.h:2171: warning: "FindResource" redefined
#define FindResource __MINGW_NAME_AW(FindResource)
In file included from mingw-w64-headers/include/winbase.h:24,
from mingw-w64-headers/include/windows.h:70,
from libsrc/dxerr.c:15,
from libsrc/dxerr8w.c:20:
mingw-w64-headers/include/libloaderapi.h:62: note: this is the location of the previous definition
#define FindResource FindResourceW
Fix it by conditionally defining FindResource in winbase.h directly as
FindResourceA for non-UNICODE builds and let libloaderapi.h to define
FindResource as FindResourceW for UNICODE builds.
Signed-off-by: LIU Hao <lh_mouse@126.com>
diff --git a/mingw-w64-headers/include/winbase.h b/mingw-w64-headers/include/winbase.h
index 05813b9..f0affe0 100644
--- a/mingw-w64-headers/include/winbase.h
+++ b/mingw-w64-headers/include/winbase.h
@@ -2074,6 +2074,7 @@
#ifndef UNICODE
#define GetStartupInfo GetStartupInfoA
+#define FindResource FindResourceA
#define FindResourceEx FindResourceExA
#define EnumResourceNames EnumResourceNamesA
#endif
@@ -2167,8 +2168,6 @@
WINBASEAPI WINBOOL WINAPI SetDllDirectoryA (LPCSTR lpPathName);
WINBASEAPI WINBOOL WINAPI SetDllDirectoryW (LPCWSTR lpPathName);
WINBASEAPI HRSRC WINAPI FindResourceW (HMODULE hModule, LPCWSTR lpName, LPCWSTR lpType);
-
-#define FindResource __MINGW_NAME_AW(FindResource)
#endif
#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP) || NTDDI_VERSION >= NTDDI_WIN10_VB