From 2773749ba3aacbcda549ed770f2f6de00f1bd0e0 Mon Sep 17 00:00:00 2001 From: Nathanne Isip Date: Fri, 13 Dec 2024 21:42:47 +0800 Subject: [PATCH] Fixed implementation of VariableDeclarationExpression::loadNativeFunction() for Windows target. --- src/n8/ast/expression/VariableDeclarationExpression.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/n8/ast/expression/VariableDeclarationExpression.cpp b/src/n8/ast/expression/VariableDeclarationExpression.cpp index 0aa8cfa..2be01ff 100644 --- a/src/n8/ast/expression/VariableDeclarationExpression.cpp +++ b/src/n8/ast/expression/VariableDeclarationExpression.cpp @@ -89,10 +89,10 @@ NativeFunction VariableDeclarationExpression::loadNativeFunction( #if defined(_WIN32) || defined(_WIN64) || defined(WIN32) || defined(WIN64) std::filesystem::path path(library); - std::wstring parentPath(path.parent_path().string().c_str()); + std::wstring parentPath = path.parent_path().wstring(); handle = LoadLibraryA(library.c_str()); - SetDllDirectoryW(static_cast(parentPath.c_str())); + SetDllDirectoryW(parentPath.c_str()); #elif defined(__APPLE__) handle = dlopen(library.c_str(), RTLD_LAZY);