diff --git a/src/share/win_utf8_io/win_utf8_io.c b/src/share/win_utf8_io/win_utf8_io.c index bbb6a74a..8b20bbb7 100644 --- a/src/share/win_utf8_io/win_utf8_io.c +++ b/src/share/win_utf8_io/win_utf8_io.c @@ -110,7 +110,11 @@ int get_utf8_argv(int *argc, char ***argv) char **utf8argv; int ret, i; +#if defined (WINAPI_FAMILY_PARTITION) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM) + if ((handle = LoadPackagedLibrary("msvcrt.dll", 0)) == NULL) return 1; +#else if ((handle = LoadLibraryW(L"msvcrt.dll")) == NULL) return 1; +#endif if ((wgetmainargs = (wgetmainargs_t)GetProcAddress(handle, "__wgetmainargs")) == NULL) { FreeLibrary(handle); return 1;