We just use ltdl's implementation for this abstraction now. Its portable to
authorReid Spencer <rspencer@reidspencer.com>
Mon, 29 Nov 2004 12:39:10 +0000 (12:39 +0000)
committerReid Spencer <rspencer@reidspencer.com>
Mon, 29 Nov 2004 12:39:10 +0000 (12:39 +0000)
more platforms than LLVM supports.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18352 91177308-0d34-0410-b5e6-96231b3b80d8

lib/System/DynamicLibrary.cpp

index 477e3051c032c713a70c41453b1ab9c39226b4eb..0e1c0a30b5c614e9185439724c58543e6a56192d 100644 (file)
@@ -12,7 +12,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "llvm/System/DynamicLibrary.h"
-#include "llvm/Config/dlfcn.h"
+#include "ltdl.h"
 #include <cassert>
 
 //===----------------------------------------------------------------------===//
 //===          independent code. 
 //===----------------------------------------------------------------------===//
 
-#ifdef HAVE_LTDL_H
-
 namespace llvm {
 
 using namespace sys;
 
-#ifdef HAVE_LT_DLOPEN
-
 DynamicLibrary::DynamicLibrary() : handle(0) {
   if (0 != lt_dlinit())
     throw std::string(lt_dlerror());
@@ -63,7 +59,7 @@ void *DynamicLibrary::GetAddressOfSymbol(const char *symbolName) {
   return lt_dlsym((lt_dlhandle) handle,symbolName);
 }
 
-#else
+#if 0 
 DynamicLibrary::DynamicLibrary(const char*filename) : handle(0) {
   assert(!"Have ltdl.h but not libltdl.a!");
 }
@@ -77,12 +73,6 @@ void *DynamicLibrary::GetAddressOfSymbol(const char *symbolName) {
   return 0;
 }
 
-#endif // HAVE_DLOPEN
+#endif
 
 } // namespace llvm
-
-#else // HAVE_LTDL_H
-
-#include "platform/DynamicLibrary.cpp"
-
-#endif