From e01d6014f97126c8561676433b3071df60313810 Mon Sep 17 00:00:00 2001
From: Mathieu Malaterre <mathieu.malaterre@gmail.com>
Date: Fri, 10 Mar 2006 11:57:43 -0500
Subject: [PATCH] ENH: Make sure that we find the proper symbol and not the one
 that start with _. STYLE: Remove an old style cast

---
 DynamicLoader.cxx     | 2 +-
 testDynamicLoader.cxx | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/DynamicLoader.cxx b/DynamicLoader.cxx
index e60a6fd..6136d4f 100644
--- a/DynamicLoader.cxx
+++ b/DynamicLoader.cxx
@@ -305,7 +305,7 @@ int DynamicLoader::CloseLibrary(LibHandle lib)
   if (lib)
     {
     // The function dlclose() returns 0 on success, and non-zero on error.
-    return !(int)dlclose(lib);
+    return !dlclose(lib);
     }
   // else
   return 0;
diff --git a/testDynamicLoader.cxx b/testDynamicLoader.cxx
index 5c04dd5..68839d6 100644
--- a/testDynamicLoader.cxx
+++ b/testDynamicLoader.cxx
@@ -89,7 +89,9 @@ int main(int , char *[])
   kwsys_stl::string libname = GetLibName("testDynload");
   res += TestDynamicLoader(libname.c_str(), "dummy",1,0,1);
   res += TestDynamicLoader(libname.c_str(), "TestDynamicLoaderFunction",1,1,1);
+  res += TestDynamicLoader(libname.c_str(), "_TestDynamicLoaderFunction",1,0,1);
   res += TestDynamicLoader(libname.c_str(), "TestDynamicLoaderData",1,1,1);
+  res += TestDynamicLoader(libname.c_str(), "_TestDynamicLoaderData",1,0,1);
 
   return res;
 }
-- 
GitLab