changeset 1032:57400f233de8

fix KFreeBSD build
author jodogne
date Thu, 10 Jul 2014 17:41:22 +0200
parents 703a552b52bc
children b24954e7ebfa 39537e2fe637
files Plugins/Engine/PluginsManager.cpp Plugins/Engine/SharedLibrary.cpp UnitTestsSources/PluginsTests.cpp
diffstat 3 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/Plugins/Engine/PluginsManager.cpp	Thu Jul 10 15:13:33 2014 +0200
+++ b/Plugins/Engine/PluginsManager.cpp	Thu Jul 10 17:41:22 2014 +0200
@@ -42,7 +42,7 @@
 
 #ifdef WIN32
 #define PLUGIN_EXTENSION ".dll"
-#elif defined(__linux)
+#elif defined(__linux) || defined(__FreeBSD_kernel__)
 #define PLUGIN_EXTENSION ".so"
 #elif defined(__APPLE__) && defined(__MACH__)
 #define PLUGIN_EXTENSION ".dylib"
--- a/Plugins/Engine/SharedLibrary.cpp	Thu Jul 10 15:13:33 2014 +0200
+++ b/Plugins/Engine/SharedLibrary.cpp	Thu Jul 10 17:41:22 2014 +0200
@@ -36,7 +36,7 @@
 
 #if defined(_WIN32)
 #include <windows.h>
-#elif defined(__linux) || (defined(__APPLE__) && defined(__MACH__))
+#elif defined(__linux) || (defined(__APPLE__) && defined(__MACH__)) || defined(__FreeBSD_kernel__)
 #include <dlfcn.h>
 #else
 #error Support your platform here
@@ -58,7 +58,7 @@
       throw OrthancException(ErrorCode_SharedLibrary);
     }
 
-#elif defined(__linux) || (defined(__APPLE__) && defined(__MACH__))
+#elif defined(__linux) || (defined(__APPLE__) && defined(__MACH__)) || defined(__FreeBSD_kernel__)
     handle_ = ::dlopen(path.c_str(), RTLD_NOW);
     if (handle_ == NULL) 
     {
@@ -84,7 +84,7 @@
     {
 #if defined(_WIN32)
       ::FreeLibrary((HMODULE)handle_);
-#elif defined(__linux) || (defined(__APPLE__) && defined(__MACH__))
+#elif defined(__linux) || (defined(__APPLE__) && defined(__MACH__)) || defined(__FreeBSD_kernel__)
       ::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) || (defined(__APPLE__) && defined(__MACH__))
+#elif defined(__linux) || (defined(__APPLE__) && defined(__MACH__)) || defined(__FreeBSD_kernel__)
     return ::dlsym(handle_, name.c_str());
 #else
 #error Support your platform here
--- a/UnitTestsSources/PluginsTests.cpp	Thu Jul 10 15:13:33 2014 +0200
+++ b/UnitTestsSources/PluginsTests.cpp	Thu Jul 10 17:41:22 2014 +0200
@@ -48,7 +48,7 @@
   ASSERT_TRUE(l.HasFunction("GetVersionExW"));
   ASSERT_FALSE(l.HasFunction("world"));
 
-#elif defined(__linux)
+#elif defined(__linux) || defined(__FreeBSD_kernel__)
   SharedLibrary l("libdl.so");
   ASSERT_THROW(l.GetFunction("world"), OrthancException);
   ASSERT_TRUE(l.GetFunction("dlopen") != NULL);