The non-suffixed macro GetModuleHandle depends on whether the file is
being compiled in Unicode mode or not. Prefer using the char string
literal in this simple case.

Signed-off-by: Antonin Décimo <anto...@tarides.com>
---
 mingw-w64-libraries/winpthreads/src/misc.c   | 2 +-
 mingw-w64-libraries/winpthreads/src/thread.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/mingw-w64-libraries/winpthreads/src/misc.c 
b/mingw-w64-libraries/winpthreads/src/misc.c
index 0aaeba913..425892575 100644
--- a/mingw-w64-libraries/winpthreads/src/misc.c
+++ b/mingw-w64-libraries/winpthreads/src/misc.c
@@ -32,7 +32,7 @@ __attribute__((constructor))
 #endif
 static void winpthreads_init(void)
 {
-    HMODULE mod = GetModuleHandle("kernel32.dll");
+    HMODULE mod = GetModuleHandleA("kernel32.dll");
     if (!mod) return;
 
     GetTickCount64FuncPtr = (ULONGLONG (WINAPI *)(VOID))(void*) 
GetProcAddress(mod,
diff --git a/mingw-w64-libraries/winpthreads/src/thread.c 
b/mingw-w64-libraries/winpthreads/src/thread.c
index a0bd711d1..bdc1a2a13 100644
--- a/mingw-w64-libraries/winpthreads/src/thread.c
+++ b/mingw-w64-libraries/winpthreads/src/thread.c
@@ -81,7 +81,7 @@ static ULONG (*RemoveVectoredExceptionHandlerFuncPtr) (PVOID);
 static void __attribute__((constructor))
 ctor (void)
 {
-  HMODULE module = GetModuleHandle("kernel32.dll");
+  HMODULE module = GetModuleHandleA("kernel32.dll");
   if (module) {
     AddVectoredExceptionHandlerFuncPtr = 
(__typeof__(AddVectoredExceptionHandlerFuncPtr)) GetProcAddress(module, 
"AddVectoredExceptionHandler");
     RemoveVectoredExceptionHandlerFuncPtr = 
(__typeof__(RemoveVectoredExceptionHandlerFuncPtr)) GetProcAddress(module, 
"RemoveVectoredExceptionHandler");
-- 
2.43.0



_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to