Skip to content

Commit

Permalink
Fix windows fluid dir path.
Browse files Browse the repository at this point in the history
  • Loading branch information
vegardjervell committed Nov 8, 2024
1 parent 0c4258a commit 0cf973d
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions cpp/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,12 @@ static void __set_fluid_dir() {
fluid_dir = rel_fluid_dir;
}
else {
char path[MAX_PATH];
char chr_path[MAX_PATH];
HMODULE hModule = NULL;
GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,
(LPCSTR)&get_fluid_dir, &hModule);
GetModuleFileName(hModule, path, sizeof(path));
GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, (LPCSTR)&get_fluid_dir, &hModule);
GetModuleFileName(hModule, chr_path, sizeof(chr_path));

std::string libPath = std::string(path);
std::string libPath = std::string(chr_path);
std::filesystem::path path(libPath);
fluid_dir = std::string(path.parent_path() / rel_fluid_dir);
}
Expand Down

0 comments on commit 0cf973d

Please sign in to comment.