summaryrefslogtreecommitdiffstats
path: root/Source/kwsys/testDynamicLoader.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/kwsys/testDynamicLoader.cxx')
-rw-r--r--Source/kwsys/testDynamicLoader.cxx27
1 files changed, 13 insertions, 14 deletions
diff --git a/Source/kwsys/testDynamicLoader.cxx b/Source/kwsys/testDynamicLoader.cxx
index 58adb84..695a134 100644
--- a/Source/kwsys/testDynamicLoader.cxx
+++ b/Source/kwsys/testDynamicLoader.cxx
@@ -12,8 +12,6 @@
#include "kwsysPrivate.h"
#include KWSYS_HEADER(DynamicLoader.hxx)
-#include KWSYS_HEADER(ios/iostream)
-#include KWSYS_HEADER(stl/string)
#if defined(__BEOS__) || defined(__HAIKU__)
#include <be/kernel/OS.h> /* disable_debugger() API. */
@@ -23,18 +21,19 @@
// duplicate the above list of headers.
#if 0
# include "DynamicLoader.hxx.in"
-# include "kwsys_ios_iostream.h.in"
-# include "kwsys_stl_string.hxx.in"
#endif
+#include <string>
+#include <iostream>
+
// Include with <> instead of "" to avoid getting any in-source copy
// left on disk.
#include <testSystemTools.h>
-static kwsys_stl::string GetLibName(const char* lname)
+static std::string GetLibName(const char* lname)
{
// Construct proper name of lib
- kwsys_stl::string slname;
+ std::string slname;
slname = EXECUTABLE_OUTPUT_PATH;
#ifdef CMAKE_INTDIR
slname += "/";
@@ -56,30 +55,30 @@ static kwsys_stl::string GetLibName(const char* lname)
*/
int TestDynamicLoader(const char* libname, const char* symbol, int r1, int r2, int r3)
{
- kwsys_ios::cerr << "Testing: " << libname << kwsys_ios::endl;
+ std::cerr << "Testing: " << libname << std::endl;
kwsys::DynamicLoader::LibraryHandle l
= kwsys::DynamicLoader::OpenLibrary(libname);
// If result is incompatible with expectation just fails (xor):
if( (r1 && !l) || (!r1 && l) )
{
- kwsys_ios::cerr
- << kwsys::DynamicLoader::LastError() << kwsys_ios::endl;
+ std::cerr
+ << kwsys::DynamicLoader::LastError() << std::endl;
return 1;
}
kwsys::DynamicLoader::SymbolPointer f
= kwsys::DynamicLoader::GetSymbolAddress(l, symbol);
if( (r2 && !f) || (!r2 && f) )
{
- kwsys_ios::cerr
- << kwsys::DynamicLoader::LastError() << kwsys_ios::endl;
+ std::cerr
+ << kwsys::DynamicLoader::LastError() << std::endl;
return 1;
}
#ifndef __APPLE__
int s = kwsys::DynamicLoader::CloseLibrary(l);
if( (r3 && !s) || (!r3 && s) )
{
- kwsys_ios::cerr
- << kwsys::DynamicLoader::LastError() << kwsys_ios::endl;
+ std::cerr
+ << kwsys::DynamicLoader::LastError() << std::endl;
return 1;
}
#else
@@ -118,7 +117,7 @@ int testDynamicLoader(int argc, char *argv[])
res += TestDynamicLoader("libdl.so", "TestDynamicLoader",1,0,1);
#endif
// Now try on the generated library
- kwsys_stl::string libname = GetLibName(KWSYS_NAMESPACE_STRING "TestDynload");
+ std::string libname = GetLibName(KWSYS_NAMESPACE_STRING "TestDynload");
res += TestDynamicLoader(libname.c_str(), "dummy",1,0,1);
res += TestDynamicLoader(libname.c_str(), "TestDynamicLoaderSymbolPointer",1,1,1);
res += TestDynamicLoader(libname.c_str(), "_TestDynamicLoaderSymbolPointer",1,0,1);