ENH: Cleanup DynamicLoader so that the symbols have more consistent names, start using dynamic loader from kwsys in CMake

This commit is contained in:
Andy Cedilnik
2006-03-16 11:01:05 -05:00
parent 4102949bf9
commit f483e48d2a
12 changed files with 134 additions and 375 deletions

View File

@@ -15,6 +15,7 @@ extern "C" {
#include "cmSystemTools.h"
#include "cmOrderLinkDirectories.h"
#include "cmGeneratedFileStream.h"
#include <cmsys/DynamicLoader.hxx>
#else
#include <vector>
#include <string>
@@ -327,7 +328,7 @@ int main()
lib += cmDynamicLoader::LibPrefix();
lib += "CMakeTestModule";
lib += cmDynamicLoader::LibExtension();
cmLibHandle handle = cmDynamicLoader::OpenLibrary(lib.c_str());
cmsys::DynamicLoader::LibraryHandle handle = cmDynamicLoader::OpenLibrary(lib.c_str());
if(!handle)
{
std::string err = "Can not open CMakeTestModule:\n";
@@ -336,11 +337,11 @@ int main()
}
else
{
cmDynamicLoaderFunction fun =
cmDynamicLoader::GetSymbolAddress(handle, "ModuleFunction");
cmsys::DynamicLoader::SymbolPointer fun =
cmsys::DynamicLoader::GetSymbolAddress(handle, "ModuleFunction");
if(!fun)
{
fun = cmDynamicLoader::GetSymbolAddress(handle, "_ModuleFunction");
fun = cmsys::DynamicLoader::GetSymbolAddress(handle, "_ModuleFunction");
}
typedef int (*TEST_FUNCTION)();
TEST_FUNCTION testFun = (TEST_FUNCTION)fun;