all repos — mgba @ 3c4929b798ab3b48b64d3b0dfe7804a26d9dd4f9

mGBA Game Boy Advance Emulator

Core: Fix build on Windows
Vicki Pfau vi@endrift.com
Tue, 08 Dec 2020 23:22:51 -0800
commit

3c4929b798ab3b48b64d3b0dfe7804a26d9dd4f9

parent

c398bd41e5f7be707e8bd9e23b0e04ce333457ee

1 files changed, 2 insertions(+), 2 deletions(-)

jump to
M src/core/config.csrc/core/config.c

@@ -213,7 +213,9 @@ }

} #ifdef _WIN32 wchar_t wpath[MAX_PATH]; + wchar_t wprojectName[MAX_PATH]; wchar_t* home; + MultiByteToWideChar(CP_UTF8, 0, projectName, -1, wprojectName, MAX_PATH); SHGetKnownFolderPath(&FOLDERID_RoamingAppData, 0, NULL, &home); StringCchPrintfW(wpath, MAX_PATH, L"%ws\\%ws", home, wprojectName); CoTaskMemFree(home);

@@ -250,8 +252,6 @@

void mCoreConfigPortablePath(char* out, size_t outLength) { #ifdef _WIN32 wchar_t wpath[MAX_PATH]; - wchar_t wprojectName[MAX_PATH]; - MultiByteToWideChar(CP_UTF8, 0, projectName, -1, wprojectName, MAX_PATH); HMODULE hModule = GetModuleHandleW(NULL); GetModuleFileNameW(hModule, wpath, MAX_PATH); PathRemoveFileSpecW(wpath);