COMP: add a dynamic loader for systems which don't support dynamic loading, so this is handled in kwsys and not every project using this has to care for it

Alex
This commit is contained in:
Alexander Neundorf 2007-07-30 15:52:36 -04:00
parent a9d19d884e
commit 220fe4f3ce
1 changed files with 56 additions and 1 deletions

View File

@ -435,7 +435,62 @@ const char* DynamicLoader::LastError()
#endif
// ---------------------------------------------------------------
// 5. Implementation for default UNIX machines.
// 5. Implementation for systems without dynamic libs
// __gnu_blrts__ is IBM BlueGene/L
#ifdef __gnu_blrts__
#include <string.h> // for strerror()
#define DYNAMICLOADER_DEFINED 1
namespace KWSYS_NAMESPACE
{
//----------------------------------------------------------------------------
DynamicLoader::LibraryHandle DynamicLoader::OpenLibrary(const char* libname )
{
return 0;
}
//----------------------------------------------------------------------------
int DynamicLoader::CloseLibrary(DynamicLoader::LibraryHandle lib)
{
if (!lib)
{
return 0;
}
return 1;
}
//----------------------------------------------------------------------------
DynamicLoader::SymbolPointer DynamicLoader::GetSymbolAddress(
DynamicLoader::LibraryHandle lib, const char* sym)
{
return 0;
}
//----------------------------------------------------------------------------
const char* DynamicLoader::LibPrefix()
{
return "lib";
}
//----------------------------------------------------------------------------
const char* DynamicLoader::LibExtension()
{
return ".a";
}
//----------------------------------------------------------------------------
const char* DynamicLoader::LastError()
{
return "General error";
}
} // namespace KWSYS_NAMESPACE
#endif
// ---------------------------------------------------------------
// 6. Implementation for default UNIX machines.
// if nothing has been defined then use this
#ifndef DYNAMICLOADER_DEFINED
#define DYNAMICLOADER_DEFINED 1