From e403976bf6e3d7c9a487c8be3918f74dca7af1b9 Mon Sep 17 00:00:00 2001 From: nu774 Date: Wed, 22 Jul 2015 21:55:19 +0900 Subject: [PATCH] fix build issue on MSVC14 --- src/compat_win32.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/compat_win32.c b/src/compat_win32.c index 4482281..5cf8a96 100644 --- a/src/compat_win32.c +++ b/src/compat_win32.c @@ -97,11 +97,16 @@ void aacenc_free_mainargs(void) void aacenc_getmainargs(int *argc, char ***argv) { + static int (*fp__wgetmainargs)(int *, wchar_t ***, wchar_t ***, + int, _startupinfo *); int i; wchar_t **wargv, **envp; _startupinfo si = { 0 }; + HMODULE h = LoadLibraryA("msvcrt.dll"); + fp__wgetmainargs = (void *)GetProcAddress(h, "__wgetmainargs"); + (*fp__wgetmainargs)(argc, &wargv, &envp, 1, &si); + FreeLibrary(h); - __wgetmainargs(argc, &wargv, &envp, 1, &si); *argv = malloc((*argc + 1) * sizeof(char*)); for (i = 0; i < *argc; ++i) codepage_encode_wchar(CP_UTF8, wargv[i], &(*argv)[i]);