Fix build with MSVC if UNICODE is enabled
authorErik de Castro Lopo <erikd@mega-nerd.com>
Tue, 3 Jan 2017 19:30:42 +0000 (06:30 +1100)
committerErik de Castro Lopo <erikd@mega-nerd.com>
Tue, 3 Jan 2017 19:31:52 +0000 (06:31 +1100)
Patch-from: "lvqcl.mail" <lvqcl.mail@gmail.com>
Closes: https://sourceforge.net/p/flac/bugs/447/

src/share/win_utf8_io/win_utf8_io.c
src/utils/flactimer/main.cpp

index c61d27f..bb07ccd 100644 (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;
index f2777e2..a01945f 100644 (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