From 9ca790a6414b43c81ed0d539e9d200cc25ea4b0e Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Tue, 4 Jul 2023 10:42:28 +0200 Subject: [PATCH] win32: thread: use the proper signature for DllMain _DECL_DLLMAIN is needed to get the signature of DllMain. But depending whether windows.h is included the signature differs (WINAPI, HANDLE, etc). This is only the case in mingw-w64. In the Windows SDK there's only the definition without the fancy types. We need to include process.h before windows.h so we have the same definition as the Windows SDK. --- src/win32/thread.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/win32/thread.c b/src/win32/thread.c index bfb349b971..9037d72d3f 100644 --- a/src/win32/thread.c +++ b/src/win32/thread.c @@ -30,6 +30,7 @@ #endif #define _DECL_DLLMAIN +#include #include #include #include @@ -706,7 +707,7 @@ void vlc_threads_setup(libvlc_int_t *vlc) #define LOOKUP(s) (((s##_) = (void *)GetProcAddress(h, #s)) != NULL) -BOOL WINAPI DllMain (HANDLE hinstDll, DWORD fdwReason, LPVOID lpvReserved) +int __stdcall DllMain (void *hinstDll, unsigned fdwReason, void *lpvReserved) { (void) hinstDll; (void) lpvReserved;