diff options
Diffstat (limited to 'Tests/Plugin/src/example_exe.cxx')
-rw-r--r-- | Tests/Plugin/src/example_exe.cxx | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/Tests/Plugin/src/example_exe.cxx b/Tests/Plugin/src/example_exe.cxx index 257a35c..fd810a9 100644 --- a/Tests/Plugin/src/example_exe.cxx +++ b/Tests/Plugin/src/example_exe.cxx @@ -1,4 +1,4 @@ -#include <kwsys/DynamicLoader.hxx> +#include "DynamicLoader.hxx" #include <example.h> @@ -24,20 +24,17 @@ extern "C" int example_exe_function() int main() { - std::string libName = EXAMPLE_EXE_PLUGIN_DIR CONFIG_DIR "/"; - libName += kwsys::DynamicLoader::LibPrefix(); - libName += "example_mod_1"; - libName += kwsys::DynamicLoader::LibExtension(); - kwsys::DynamicLoader::LibraryHandle handle = - kwsys::DynamicLoader::OpenLibrary(libName.c_str()); + std::string const libName = EXAMPLE_EXE_PLUGIN_DIR CONFIG_DIR + "/" EXAMPLE_EXE_MOD_PREFIX "example_mod_1" EXAMPLE_EXE_MOD_SUFFIX; + DynamicLoader::LibraryHandle handle = DynamicLoader::OpenLibrary(libName); if (!handle) { // Leave the .c_str() on this one. It is needed on OpenWatcom. std::cerr << "Could not open plugin \"" << libName.c_str() << "\"!" << std::endl; return 1; } - kwsys::DynamicLoader::SymbolPointer sym = - kwsys::DynamicLoader::GetSymbolAddress(handle, "example_mod_1_function"); + DynamicLoader::SymbolPointer sym = + DynamicLoader::GetSymbolAddress(handle, "example_mod_1_function"); if (!sym) { std::cerr << "Could not get plugin symbol \"example_mod_1_function\"!" << std::endl; @@ -52,6 +49,6 @@ int main() std::cerr << "Incorrect return value from plugin!" << std::endl; return 1; } - kwsys::DynamicLoader::CloseLibrary(handle); + DynamicLoader::CloseLibrary(handle); return 0; } |