Core: Fix build on Windows

This commit is contained in:
Vicki Pfau 2020-12-08 23:22:51 -08:00
parent c398bd41e5
commit 3c4929b798
1 changed files with 2 additions and 2 deletions
src/core

View File

@ -213,7 +213,9 @@ void mCoreConfigDirectory(char* out, size_t outLength) {
}
#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 mCoreConfigDirectory(char* out, size_t outLength) {
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);