BUG: Make sure to use the Win32 interface (HINSTANCE) for handling shared lib on cygwin and mingw system

This commit is contained in:
Mathieu Malaterre 2006-12-08 15:52:30 -05:00
parent 1dd5db0235
commit 458fa7559b
3 changed files with 6 additions and 4 deletions

View File

@ -718,7 +718,9 @@ IF(KWSYS_C_SRCS OR KWSYS_CXX_SRCS)
${KWSYS_C_SRCS} ${KWSYS_CXX_SRCS})
IF(KWSYS_USE_DynamicLoader)
IF(UNIX)
TARGET_LINK_LIBRARIES(${KWSYS_NAMESPACE} ${CMAKE_DL_LIBS})
IF(NOT CYGWIN AND NOT MINGW)
TARGET_LINK_LIBRARIES(${KWSYS_NAMESPACE} ${CMAKE_DL_LIBS})
ENDIF(NOT CYGWIN AND NOT MINGW)
ENDIF(UNIX)
ENDIF(KWSYS_USE_DynamicLoader)

View File

@ -220,7 +220,7 @@ const char* DynamicLoader::LastError()
// ---------------------------------------------------------------
// 3. Implementation for Windows win32 code
#ifdef _WIN32
#if defined(_WIN32) || defined(__CYGWIN__) || defined(__MINGW32__)
#include <windows.h>
#define DYNAMICLOADER_DEFINED 1

View File

@ -18,7 +18,7 @@
#if defined(__hpux)
#include <dl.h>
#elif defined(_WIN32)
#elif defined(_WIN32) || defined(__CYGWIN__) || defined(__MINGW32__)
#include <windows.h>
#elif defined(__APPLE__)
#include <AvailabilityMacros.h>
@ -56,7 +56,7 @@ public:
// They are different on several different OS's
#if defined(__hpux)
typedef shl_t LibraryHandle;
#elif defined(_WIN32)
#elif defined(_WIN32) || defined(__CYGWIN__) || defined(__MINGW32__)
typedef HMODULE LibraryHandle;
#elif defined(__APPLE__)
#if MAC_OS_X_VERSION_MAX_ALLOWED < 1030