Fix build with MSVC if UNICODE is enabled

Patch-from: "lvqcl.mail" <lvqcl.mail@gmail.com>
Closes: https://sourceforge.net/p/flac/bugs/447/
This commit is contained in:
Erik de Castro Lopo 2017-01-04 06:30:42 +11:00
parent 230cffe08f
commit 58a81cf678
2 changed files with 4 additions and 4 deletions

View File

@ -110,7 +110,7 @@ int get_utf8_argv(int *argc, char ***argv)
char **utf8argv;
int ret, i;
if ((handle = LoadLibrary("msvcrt.dll")) == NULL) return 1;
if ((handle = LoadLibraryW(L"msvcrt.dll")) == NULL) return 1;
if ((wgetmainargs = (wgetmainargs_t)GetProcAddress(handle, "__wgetmainargs")) == NULL) {
FreeLibrary(handle);
return 1;

View File

@ -116,13 +116,13 @@ int main(int argc, char *argv[])
//fprintf(stderr, "@@@ cmd=[%s] args=[%s]\n", argv[0], args);
STARTUPINFO si;
GetStartupInfo(&si);
STARTUPINFOA si;
GetStartupInfoA(&si);
DWORD wallclock_msec = GetTickCount();
PROCESS_INFORMATION pi;
BOOL ok = CreateProcess(
BOOL ok = CreateProcessA(
argv[0], // lpApplicationName
args, // lpCommandLine
NULL, // lpProcessAttributes