# HG changeset patch # User Sebastien Jodogne # Date 1467200424 -7200 # Node ID 54417b0831c4810eabbb614226b468e701b3e122 # Parent e166a902b3c479d486d0b9275541096861619f96 cont diff -r e166a902b3c4 -r 54417b0831c4 Core/Toolbox.cpp --- a/Core/Toolbox.cpp Mon Jun 27 17:35:58 2016 +0200 +++ b/Core/Toolbox.cpp Wed Jun 29 13:40:24 2016 +0200 @@ -111,6 +111,7 @@ namespace Orthanc { +#if !defined(ORTHANC_SANDBOXED) || ORTHANC_SANDBOXED != 1 static bool finish_; static ServerBarrierEvent barrierEvent_; @@ -188,6 +189,7 @@ const bool stopFlag = false; return ServerBarrierInternal(&stopFlag); } +#endif /* ORTHANC_SANDBOXED */ void Toolbox::ToUpperCase(std::string& s) @@ -677,11 +679,15 @@ return std::string(pathbuf); } +#elif defined(ORTHANC_SANDBOXED) && ORTHANC_SANDBOXED == 1 + // Sandboxed Orthanc, no access to the executable + #else #error Support your platform here #endif +#if !defined(ORTHANC_SANDBOXED) || ORTHANC_SANDBOXED != 1 std::string Toolbox::GetPathToExecutable() { boost::filesystem::path p(GetPathToExecutableInternal()); @@ -694,6 +700,7 @@ boost::filesystem::path p(GetPathToExecutableInternal()); return boost::filesystem::absolute(p.parent_path()).string(); } +#endif static const char* GetBoostLocaleEncoding(const Encoding sourceEncoding) diff -r e166a902b3c4 -r 54417b0831c4 Core/Toolbox.h --- a/Core/Toolbox.h Mon Jun 27 17:35:58 2016 +0200 +++ b/Core/Toolbox.h Wed Jun 29 13:40:24 2016 +0200 @@ -49,9 +49,11 @@ namespace Toolbox { +#if !defined(ORTHANC_SANDBOXED) || ORTHANC_SANDBOXED != 1 ServerBarrierEvent ServerBarrier(const bool& stopFlag); ServerBarrierEvent ServerBarrier(); +#endif void ToUpperCase(std::string& s); // Inplace version @@ -77,7 +79,9 @@ size_t size, const std::string& path); +#if !defined(ORTHANC_SANDBOXED) || ORTHANC_SANDBOXED != 1 void USleep(uint64_t microSeconds); +#endif void RemoveFile(const std::string& path); @@ -137,9 +141,11 @@ const std::string& content); #endif +#if !defined(ORTHANC_SANDBOXED) || ORTHANC_SANDBOXED != 1 std::string GetPathToExecutable(); std::string GetDirectoryOfExecutable(); +#endif std::string ConvertToUtf8(const std::string& source, Encoding sourceEncoding); diff -r e166a902b3c4 -r 54417b0831c4 Plugins/Samples/Common/OrthancPluginCppWrapper.h --- a/Plugins/Samples/Common/OrthancPluginCppWrapper.h Mon Jun 27 17:35:58 2016 +0200 +++ b/Plugins/Samples/Common/OrthancPluginCppWrapper.h Wed Jun 29 13:40:24 2016 +0200 @@ -332,6 +332,24 @@ const std::string& uri, bool applyPlugins); + inline void LogError(OrthancPluginContext* context, + const std::string& message) + { + OrthancPluginLogError(context, message.c_str()); + } + + inline void LogWarning(OrthancPluginContext* context, + const std::string& message) + { + OrthancPluginLogWarning(context, message.c_str()); + } + + inline void LogInfo(OrthancPluginContext* context, + const std::string& message) + { + OrthancPluginLogInfo(context, message.c_str()); + } + namespace Internals { diff -r e166a902b3c4 -r 54417b0831c4 Resources/CMake/BoostConfiguration.cmake --- a/Resources/CMake/BoostConfiguration.cmake Mon Jun 27 17:35:58 2016 +0200 +++ b/Resources/CMake/BoostConfiguration.cmake Wed Jun 29 13:40:24 2016 +0200 @@ -54,7 +54,8 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" OR ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD" OR - ${CMAKE_SYSTEM_NAME} STREQUAL "kFreeBSD") + ${CMAKE_SYSTEM_NAME} STREQUAL "kFreeBSD" OR + ${CMAKE_SYSTEM_NAME} STREQUAL "PNaCl") list(APPEND BOOST_SOURCES ${BOOST_SOURCES_DIR}/libs/thread/src/pthread/once.cpp ${BOOST_SOURCES_DIR}/libs/thread/src/pthread/thread.cpp @@ -65,7 +66,8 @@ -DBOOST_LOCALE_NO_STD_BACKEND=1 ) - if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase") + if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase" OR + ${CMAKE_SYSTEM_NAME} STREQUAL "PNaCl") add_definitions(-DBOOST_HAS_SCHED_YIELD=1) endif() @@ -119,7 +121,8 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" OR ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD" OR - ${CMAKE_SYSTEM_NAME} STREQUAL "kFreeBSD") + ${CMAKE_SYSTEM_NAME} STREQUAL "kFreeBSD" OR + ${CMAKE_SYSTEM_NAME} STREQUAL "PNaCl") list(APPEND BOOST_SOURCES ${BOOST_SOURCES_DIR}/libs/locale/src/posix/codecvt.cpp ${BOOST_SOURCES_DIR}/libs/locale/src/posix/collate.cpp