BUG: Fix problem with loading dylib on Tiger (10.4) x86. We need to be using the dlopen/dlclose instead of the old NSModule

This commit is contained in:
Mathieu Malaterre 2006-11-29 12:56:28 -05:00
parent daa6d2bc04
commit 965a1475b6
2 changed files with 6 additions and 14 deletions

View File

@ -16,16 +16,6 @@
#include KWSYS_HEADER(Configure.hxx) #include KWSYS_HEADER(Configure.hxx)
#ifdef __APPLE__
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1030
#include <string.h> // for strlen
#endif //MAC_OS_X_VERSION_MIN_REQUIRED < 1030
#endif // __APPLE__
#ifdef __hpux
#include <errno.h>
#endif //__hpux
// Work-around CMake dependency scanning limitation. This must // Work-around CMake dependency scanning limitation. This must
// duplicate the above list of headers. // duplicate the above list of headers.
#if 0 #if 0
@ -59,6 +49,7 @@ DynamicLoader::~DynamicLoader()
// --------------------------------------------------------------- // ---------------------------------------------------------------
// 1. Implementation for HPUX machines // 1. Implementation for HPUX machines
#ifdef __hpux #ifdef __hpux
#include <errno.h>
#include <dl.h> #include <dl.h>
#define DYNAMICLOADER_DEFINED 1 #define DYNAMICLOADER_DEFINED 1
@ -141,7 +132,8 @@ const char* DynamicLoader::LastError()
// --------------------------------------------------------------- // ---------------------------------------------------------------
// 2. Implementation for Mac OS X 10.2.x and earlier // 2. Implementation for Mac OS X 10.2.x and earlier
#ifdef __APPLE__ #ifdef __APPLE__
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1030 #if MAC_OS_X_VERSION_MAX_ALLOWED < 1030
#include <string.h> // for strlen
#include <mach-o/dyld.h> #include <mach-o/dyld.h>
#define DYNAMICLOADER_DEFINED 1 #define DYNAMICLOADER_DEFINED 1
@ -223,7 +215,7 @@ const char* DynamicLoader::LastError()
} // namespace KWSYS_NAMESPACE } // namespace KWSYS_NAMESPACE
#endif //MAC_OS_X_VERSION_MIN_REQUIRED < 1030 #endif // MAC_OS_X_VERSION_MAX_ALLOWED < 1030
#endif // __APPLE__ #endif // __APPLE__
// --------------------------------------------------------------- // ---------------------------------------------------------------

View File

@ -22,7 +22,7 @@
#include <windows.h> #include <windows.h>
#elif defined(__APPLE__) #elif defined(__APPLE__)
#include <AvailabilityMacros.h> #include <AvailabilityMacros.h>
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1030 #if MAC_OS_X_VERSION_MAX_ALLOWED < 1030
#include <mach-o/dyld.h> #include <mach-o/dyld.h>
#endif #endif
#endif #endif
@ -57,7 +57,7 @@ public:
#elif defined(_WIN32) #elif defined(_WIN32)
typedef HMODULE LibraryHandle; typedef HMODULE LibraryHandle;
#elif defined(__APPLE__) #elif defined(__APPLE__)
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1030 #if MAC_OS_X_VERSION_MAX_ALLOWED < 1030
typedef NSModule LibraryHandle; typedef NSModule LibraryHandle;
#else #else
typedef void* LibraryHandle; typedef void* LibraryHandle;