Skip to content

Commit

Permalink
Fixed implementation of VariableDeclarationExpression::loadNativeFunc…
Browse files Browse the repository at this point in the history
…tion() for Windows target.
  • Loading branch information
nthnn committed Dec 13, 2024
1 parent 7bee784 commit 3199759
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/n8/ast/expression/VariableDeclarationExpression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ NativeFunction VariableDeclarationExpression::loadNativeFunction(
std::filesystem::path path(library);
std::filesystem::path parentFolder = path.parent_path();

std::string parentPathFolder = path.parent_path();
std::string parentPathFolder = parentFolder.string();
std::wstring wstr(parentPathFolder.begin(), parentPathFolder.end());

PWSTR searchPath = static_cast<PWSTR>(
Expand All @@ -101,6 +101,8 @@ NativeFunction VariableDeclarationExpression::loadNativeFunction(
wcscpy_s(searchPath, wstr.size() + 1, wstr.c_str());

AddDllDirectory(searchPath);
CoTaskMemFree(searchPath);

handle = LoadLibraryA(library.c_str());

#elif defined(__APPLE__)
Expand Down

0 comments on commit 3199759

Please sign in to comment.