The non-suffixed macro GetModuleHandle depends on whether the file is
being compiled in Unicode mode or not. Prefer using the char string
literal here, for compatibility with old Windows not supporting
Unicode.

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 62acb9f50..346bc574b 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;
 
     _pthread_get_tick_count_64 =
diff --git a/mingw-w64-libraries/winpthreads/src/thread.c 
b/mingw-w64-libraries/winpthreads/src/thread.c
index ae1a37d4a..36ee66536 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