changeset 12:db07057d77ad

support of FreeBSD
author jodogne
date Tue, 07 Apr 2015 17:13:43 +0200 (2015-04-07)
parents 177d23fbeffa
children e432ee128884
files Core/Toolbox.cpp NEWS Plugin/QidoRs.cpp Plugin/WadoRs.cpp Resources/CMake/Compiler.cmake
diffstat 5 files changed, 15 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/Core/Toolbox.cpp	Tue Apr 07 16:46:00 2015 +0200
+++ b/Core/Toolbox.cpp	Tue Apr 07 17:13:43 2015 +0200
@@ -251,7 +251,7 @@
     result.reserve(source.size() + 1);
     for (size_t i = 0; i < source.size(); i++)
     {
-      if (source[i] < 128 && source[i] >= 0 && !iscntrl(source[i]))
+      if (source[i] <= 127 && source[i] >= 0 && !iscntrl(source[i]))
       {
         result.push_back(source[i]);
       }
--- a/NEWS	Tue Apr 07 16:46:00 2015 +0200
+++ b/NEWS	Tue Apr 07 17:13:43 2015 +0200
@@ -4,6 +4,7 @@
 No official release yet. Still work in progress.
 
 * Support of Visual Studio 2008
+* Support of FreeBSD
 
 
 2015/03/13
--- a/Plugin/QidoRs.cpp	Tue Apr 07 16:46:00 2015 +0200
+++ b/Plugin/QidoRs.cpp	Tue Apr 07 17:13:43 2015 +0200
@@ -562,14 +562,16 @@
 
     Json::Value instances;
     if (!OrthancPlugins::RestApiGetJson(instances, context_, uri) ||
-        instances.type() != Json::arrayValue &&
-        instances.size() != 0)
+        instances.type() != Json::arrayValue ||
+        instances.size() == 0)
     {
       return false;
     }
-
-    instance = instances[0]["ID"].asString();
-    return true;
+    else
+    {
+      instance = instances[0]["ID"].asString();
+      return true;
+    }
   }
 
 
--- a/Plugin/WadoRs.cpp	Tue Apr 07 16:46:00 2015 +0200
+++ b/Plugin/WadoRs.cpp	Tue Apr 07 17:13:43 2015 +0200
@@ -94,6 +94,7 @@
   }
 
   writer.Answer(context_, output);
+  return 0;
 }
 
 
--- a/Resources/CMake/Compiler.cmake	Tue Apr 07 16:46:00 2015 +0200
+++ b/Resources/CMake/Compiler.cmake	Tue Apr 07 17:13:43 2015 +0200
@@ -32,6 +32,11 @@
     SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++")
     SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -static-libgcc -static-libstdc++")
   endif()
+elseif (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
+  link_libraries(uuid)
+  link_directories("/usr/local/lib")
+  # This line helps CHECK_INCLUDE_FILE_CXX macro to find files
+  SET(CMAKE_REQUIRED_INCLUDES "/usr/local/include")
 endif ()
 
 if (CMAKE_COMPILER_IS_GNUCXX)