#if defined(HAVE_DLFCN_H) && defined(HAVE_DLOPEN)
#include <dlfcn.h>
DynamicLibrary::HandleSet::~HandleSet() { … }
void *DynamicLibrary::HandleSet::DLOpen(const char *File, std::string *Err) { … }
void DynamicLibrary::HandleSet::DLClose(void *Handle) { … }
void *DynamicLibrary::HandleSet::DLSym(void *Handle, const char *Symbol) { … }
#else
DynamicLibrary::HandleSet::~HandleSet() {}
void *DynamicLibrary::HandleSet::DLOpen(const char *File, std::string *Err) {
if (Err)
*Err = "dlopen() not supported on this platform";
return &Invalid;
}
void DynamicLibrary::HandleSet::DLClose(void *Handle) {}
void *DynamicLibrary::HandleSet::DLSym(void *Handle, const char *Symbol) {
return nullptr;
}
#endif
static void *DoSearch(const char *SymbolName) { … }