Skip to content
Snippets Groups Projects
Commit 4d4d274f authored by Mathieu Malaterre's avatar Mathieu Malaterre
Browse files

BUG: revert yesterday patch. The implementation was correct. The problem was...

BUG: revert yesterday patch. The implementation was correct. The problem was that _WIN32 was forced to be #define on cygwin when included from ITK, which was miss matching the implementation from the declaration. Put extra condition for CYGWIN system
parent 6097ac5c
No related branches found
No related tags found
No related merge requests found
......@@ -718,9 +718,7 @@ IF(KWSYS_C_SRCS OR KWSYS_CXX_SRCS)
${KWSYS_C_SRCS} ${KWSYS_CXX_SRCS})
IF(KWSYS_USE_DynamicLoader)
IF(UNIX)
IF(NOT CYGWIN AND NOT MINGW)
TARGET_LINK_LIBRARIES(${KWSYS_NAMESPACE} ${CMAKE_DL_LIBS})
ENDIF(NOT CYGWIN AND NOT MINGW)
TARGET_LINK_LIBRARIES(${KWSYS_NAMESPACE} ${CMAKE_DL_LIBS})
ENDIF(UNIX)
ENDIF(KWSYS_USE_DynamicLoader)
......
......@@ -219,8 +219,8 @@ const char* DynamicLoader::LastError()
#endif // __APPLE__
// ---------------------------------------------------------------
// 3. Implementation for Windows win32 code
#if defined(_WIN32) || defined(__CYGWIN__) || defined(__MINGW32__)
// 3. Implementation for Windows win32 code but not cygwin
#if defined(_WIN32) && !defined(__CYGWIN__)
#include <windows.h>
#define DYNAMICLOADER_DEFINED 1
......
......@@ -18,7 +18,7 @@
#if defined(__hpux)
#include <dl.h>
#elif defined(_WIN32) || defined(__CYGWIN__) || defined(__MINGW32__)
#elif defined(_WIN32) && !defined(__CYGWIN__)
#include <windows.h>
#elif defined(__APPLE__)
#include <AvailabilityMacros.h>
......@@ -47,6 +47,9 @@ namespace @KWSYS_NAMESPACE@
* Whereas this distinction does not exist on Win32. Therefore ideally you
* should be doing full path to garantee to have a consistent way of dealing
* with dynamic loading of shared library.
*
* \warning the Cygwin implementation do not use the Win32 HMODULE. Put extra
* condition so that we can include the correct declaration (POSIX)
*/
class @KWSYS_NAMESPACE@_EXPORT DynamicLoader
......@@ -56,7 +59,7 @@ public:
// They are different on several different OS's
#if defined(__hpux)
typedef shl_t LibraryHandle;
#elif defined(_WIN32) || defined(__CYGWIN__) || defined(__MINGW32__)
#elif defined(_WIN32) && !defined(__CYGWIN__)
typedef HMODULE LibraryHandle;
#elif defined(__APPLE__)
#if MAC_OS_X_VERSION_MAX_ALLOWED < 1030
......@@ -66,7 +69,7 @@ public:
#endif
#elif defined(__BEOS__)
typedef image_id LibraryHandle;
#else
#else // POSIX
typedef void* LibraryHandle;
#endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment