Skip to content

Commit

Permalink
Add test only if Paths is included
Browse files Browse the repository at this point in the history
Signed-off-by: Shreyas Atre <[email protected]>
  • Loading branch information
SAtacker committed Jan 28, 2024
1 parent d107d24 commit bd8d0e9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions lib/Interpreter/Paths.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,15 @@ namespace platform {

#if defined(_WIN32)
void* DLOpen(const std::string& Path, std::string& Err /* = nullptr */) {
auto lib = llvm::sys::DynamicLibrary::getLibrary(Path.c_str(), Err);
auto lib = llvm::sys::DynamicLibrary::getLibrary(Path.c_str(), &Err);
return lib.getOSSpecificHandle();
}

void DLClose(void* Lib, std::string& Err /* = nullptr*/) {
auto dl = llvm::sys::DynamicLibrary(Lib);
llvm::sys::DynamicLibrary::closeLibrary(dl);
if (Err) {
*Err = std::string();
if (Err.empty()) {
Err = std::string();
}
}
#else
Expand Down
4 changes: 2 additions & 2 deletions unittests/CppInterOp/DynamicLibraryManagerTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ TEST(DynamicLibraryManagerTest, Sanity) {

TEST(UtilsPlatform, DLTest) {
std::string err = "";
#ifdef __APPLE__
#if defined(__APPLE__)
auto dlopen_handle = Cpp::utils::platform::DLOpen(
"./unittests/CppInterOp/libTestSharedLib.dylib", err);
#elif defined(__WIN32__)
#elif defined(_WIN32)
auto dlopen_handle = Cpp::utils::platform::DLOpen(
"./unittests/CppInterOp/libTestSharedLib.dll", err);
#else
Expand Down

0 comments on commit bd8d0e9

Please sign in to comment.