Explicitly use Windows ANSI APIs

To avoid issues when building with unicode as the default character set.
This commit is contained in:
Ole André Vadla Ravnås 2020-11-12 23:28:00 +01:00
parent 2f72e38d60
commit d5c1aee8f1
2 changed files with 2 additions and 2 deletions

View File

@ -102,7 +102,7 @@ static void tcc_set_lib_path_w32(TCCState *s)
static void tcc_add_systemdir(TCCState *s) static void tcc_add_systemdir(TCCState *s)
{ {
char buf[1000]; char buf[1000];
GetSystemDirectory(buf, sizeof buf); GetSystemDirectoryA(buf, sizeof buf);
tcc_add_library_path(s, normalize_slashes(buf)); tcc_add_library_path(s, normalize_slashes(buf));
} }
#endif #endif

View File

@ -857,7 +857,7 @@ static void pe_build_imports(struct pe_info *pe)
if (pe->type == PE_RUN) { if (pe->type == PE_RUN) {
if (dllref) { if (dllref) {
if ( !dllref->handle ) if ( !dllref->handle )
dllref->handle = LoadLibrary(dllref->name); dllref->handle = LoadLibraryA(dllref->name);
v = (ADDR3264)GetProcAddress(dllref->handle, ordinal?(char*)0+ordinal:name); v = (ADDR3264)GetProcAddress(dllref->handle, ordinal?(char*)0+ordinal:name);
} }
if (!v) if (!v)