Core: Fix build on Windows
Vicki Pfau vi@endrift.com
Tue, 08 Dec 2020 23:22:51 -0800
1 files changed,
2 insertions(+),
2 deletions(-)
jump to
M
src/core/config.c
→
src/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);