From d5c1aee8f16099761a868cbca31bcb27883b29f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20Andr=C3=A9=20Vadla=20Ravn=C3=A5s?= Date: Thu, 12 Nov 2020 23:28:00 +0100 Subject: [PATCH] Explicitly use Windows ANSI APIs To avoid issues when building with unicode as the default character set. --- libtcc.c | 2 +- tccpe.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libtcc.c b/libtcc.c index 3698632..9fb1436 100644 --- a/libtcc.c +++ b/libtcc.c @@ -102,7 +102,7 @@ static void tcc_set_lib_path_w32(TCCState *s) static void tcc_add_systemdir(TCCState *s) { char buf[1000]; - GetSystemDirectory(buf, sizeof buf); + GetSystemDirectoryA(buf, sizeof buf); tcc_add_library_path(s, normalize_slashes(buf)); } #endif diff --git a/tccpe.c b/tccpe.c index c7dcf1a..bae64d9 100644 --- a/tccpe.c +++ b/tccpe.c @@ -857,7 +857,7 @@ static void pe_build_imports(struct pe_info *pe) if (pe->type == PE_RUN) { if (dllref) { if ( !dllref->handle ) - dllref->handle = LoadLibrary(dllref->name); + dllref->handle = LoadLibraryA(dllref->name); v = (ADDR3264)GetProcAddress(dllref->handle, ordinal?(char*)0+ordinal:name); } if (!v)