# HG changeset patch # User Sebastien Jodogne # Date 1776183414 -7200 # Node ID f24b8e529ea39975ae8db21d822de118167e5444 # Parent 161293383661952e004e47214b9c71cf74da9480 fix compatibility with orthanc framework <= 1.12.10 diff -r 161293383661 -r f24b8e529ea3 CMakeLists.txt --- a/CMakeLists.txt Tue Apr 14 15:48:07 2026 +0200 +++ b/CMakeLists.txt Tue Apr 14 18:16:54 2026 +0200 @@ -29,7 +29,9 @@ set(ORTHANC_FRAMEWORK_DEFAULT_VERSION "mainline") set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "hg") else() - set(ORTHANC_FRAMEWORK_DEFAULT_VERSION "1.12.11") + # Do NOT use framework 1.12.11 here, which is buggy because of: + # https://orthanc.uclouvain.be/hg/orthanc/rev/3bd8715e21bc + set(ORTHANC_FRAMEWORK_DEFAULT_VERSION "1.12.10") set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "web") endif() diff -r 161293383661 -r f24b8e529ea3 Plugin/WadoRsRetrieveRendered.cpp --- a/Plugin/WadoRsRetrieveRendered.cpp Tue Apr 14 15:48:07 2026 +0200 +++ b/Plugin/WadoRsRetrieveRendered.cpp Tue Apr 14 18:16:54 2026 +0200 @@ -24,7 +24,6 @@ #include "../Resources/Orthanc/Plugins/OrthancPluginCppWrapper.h" -#include #include #include #include @@ -33,6 +32,41 @@ #include +#if ORTHANC_FRAMEWORK_VERSION_IS_ABOVE(1, 12, 11) +# include +#else + +// For compatibility of Boost 1.89.0 with MSVC <= 2015, this is an excerpt from: +// https://orthanc.uclouvain.be/hg/orthanc/file/Orthanc-1.12.11/OrthancFramework/Sources/CompatibilityMath.h +namespace Orthanc +{ + namespace Math + { + namespace Internals + { + float RoundFloat(float v) + { + if (v >= 0.0f) + { + return std::floor(v + 0.5f); + } + else + { + return std::ceil(v - 0.5f); + } + } + } + + int iround(float v) + { + return static_cast(Internals::RoundFloat(v)); + } + } +} + +#endif + + #if ORTHANC_FRAMEWORK_VERSION_IS_ABOVE(1, 9, 7) # include #else