diff Plugins/Engine/SharedLibrary.cpp @ 1026:a13ccd93df28

fix OS X build
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 10 Jul 2014 12:18:40 +0200
parents f57802f8b4dc
children 57400f233de8
line wrap: on
line diff
--- a/Plugins/Engine/SharedLibrary.cpp	Thu Jul 10 11:54:21 2014 +0200
+++ b/Plugins/Engine/SharedLibrary.cpp	Thu Jul 10 12:18:40 2014 +0200
@@ -36,7 +36,7 @@
 
 #if defined(_WIN32)
 #include <windows.h>
-#elif defined(__linux)
+#elif defined(__linux) || (defined(__APPLE__) && defined(__MACH__))
 #include <dlfcn.h>
 #else
 #error Support your platform here
@@ -58,7 +58,7 @@
       throw OrthancException(ErrorCode_SharedLibrary);
     }
 
-#elif defined(__linux)
+#elif defined(__linux) || (defined(__APPLE__) && defined(__MACH__))
     handle_ = ::dlopen(path.c_str(), RTLD_NOW);
     if (handle_ == NULL) 
     {
@@ -84,7 +84,7 @@
     {
 #if defined(_WIN32)
       ::FreeLibrary((HMODULE)handle_);
-#elif defined(__linux)
+#elif defined(__linux) || (defined(__APPLE__) && defined(__MACH__))
       ::dlclose(handle_);
 #else
 #error Support your platform here
@@ -102,7 +102,7 @@
 
 #if defined(_WIN32)
     return ::GetProcAddress((HMODULE)handle_, name.c_str());
-#elif defined(__linux)
+#elif defined(__linux) || (defined(__APPLE__) && defined(__MACH__))
     return ::dlsym(handle_, name.c_str());
 #else
 #error Support your platform here