# HG changeset patch # User Sebastien Jodogne # Date 1607253691 -3600 # Node ID 93c281752e7a72d9e40224ae2226e904aaae9974 # Parent 3dffe8f7af481cd42d4549774fcbc5c51949db7e reintroduced backward ABI compatibility in Orthanc Framework .so for unit tests of Orthanc 1.7.2 to 1.8.0 diff -r 3dffe8f7af48 -r 93c281752e7a NEWS --- a/NEWS Sun Dec 06 11:42:39 2020 +0100 +++ b/NEWS Sun Dec 06 12:21:31 2020 +0100 @@ -34,6 +34,7 @@ * Fix keep-alive in the embedded HTTP server by setting the "Keep-Alive" HTTP header * Fix access to videos as a single raw frame (feature broken since Orthanc 1.6.0) * REST API now returns 404 error if deleting an inexistent peer or modality +* Improved forward ABI compatibility of Orthanc Framework (notably, no inline methods anymore) * Upgraded dependencies for static builds (notably on Windows and LSB): - civetweb 1.13 diff -r 3dffe8f7af48 -r 93c281752e7a OrthancFramework/SharedLibrary/OrthancFramework.h.in --- a/OrthancFramework/SharedLibrary/OrthancFramework.h.in Sun Dec 06 11:42:39 2020 +0100 +++ b/OrthancFramework/SharedLibrary/OrthancFramework.h.in Sun Dec 06 12:21:31 2020 +0100 @@ -51,6 +51,7 @@ * "OrthancFrameworkConfiguration.cmake" **/ +#define ORTHANC_BUILDING_FRAMEWORK_LIBRARY 0 #define ORTHANC_ENABLE_BASE64 1 #define ORTHANC_ENABLE_MD5 1 diff -r 3dffe8f7af48 -r 93c281752e7a OrthancFramework/Sources/DicomFormat/DicomTag.cpp --- a/OrthancFramework/Sources/DicomFormat/DicomTag.cpp Sun Dec 06 11:42:39 2020 +0100 +++ b/OrthancFramework/Sources/DicomFormat/DicomTag.cpp Sun Dec 06 12:21:31 2020 +0100 @@ -363,4 +363,13 @@ throw OrthancException(ErrorCode_ParameterOutOfRange); } } + + +#if ORTHANC_BUILDING_FRAMEWORK_LIBRARY == 1 + std::ostream& operator<< (std::ostream& o, const DicomTag& tag) + { + tag.FormatStream(o); + return o; + } +#endif } diff -r 3dffe8f7af48 -r 93c281752e7a OrthancFramework/Sources/DicomFormat/DicomTag.h --- a/OrthancFramework/Sources/DicomFormat/DicomTag.h Sun Dec 06 11:42:39 2020 +0100 +++ b/OrthancFramework/Sources/DicomFormat/DicomTag.h Sun Dec 06 12:21:31 2020 +0100 @@ -71,6 +71,10 @@ static void AddTagsForModule(std::set& target, DicomModule module); + +#if ORTHANC_BUILDING_FRAMEWORK_LIBRARY == 1 + ORTHANC_PUBLIC friend std::ostream& operator<< (std::ostream& o, const DicomTag& tag); +#endif }; // Aliases for the most useful tags diff -r 3dffe8f7af48 -r 93c281752e7a OrthancFramework/Sources/HttpServer/FilesystemHttpSender.h --- a/OrthancFramework/Sources/HttpServer/FilesystemHttpSender.h Sun Dec 06 11:42:39 2020 +0100 +++ b/OrthancFramework/Sources/HttpServer/FilesystemHttpSender.h Sun Dec 06 12:21:31 2020 +0100 @@ -37,7 +37,7 @@ std::string chunk_; size_t chunkSize_; - void Initialize(const boost::filesystem::path& path) ORTHANC_LOCAL; + void Initialize(const boost::filesystem::path& path); public: explicit FilesystemHttpSender(const std::string& path); diff -r 3dffe8f7af48 -r 93c281752e7a OrthancFramework/Sources/JobsEngine/Operations/JobOperationValues.cpp --- a/OrthancFramework/Sources/JobsEngine/Operations/JobOperationValues.cpp Sun Dec 06 11:42:39 2020 +0100 +++ b/OrthancFramework/Sources/JobsEngine/Operations/JobOperationValues.cpp Sun Dec 06 12:21:31 2020 +0100 @@ -31,6 +31,14 @@ namespace Orthanc { +#if ORTHANC_BUILDING_FRAMEWORK_LIBRARY == 1 + void JobOperationValues::Append(JobOperationValue* value) + { + throw OrthancException(ErrorCode_DiscontinuedAbi, "Removed in 1.8.1"); + } +#endif + + void JobOperationValues::Append(JobOperationValues& target, bool clear) { diff -r 3dffe8f7af48 -r 93c281752e7a OrthancFramework/Sources/JobsEngine/Operations/JobOperationValues.h --- a/OrthancFramework/Sources/JobsEngine/Operations/JobOperationValues.h Sun Dec 06 11:42:39 2020 +0100 +++ b/OrthancFramework/Sources/JobsEngine/Operations/JobOperationValues.h Sun Dec 06 12:21:31 2020 +0100 @@ -23,6 +23,7 @@ #pragma once #include "IJobOperationValue.h" +#include "../../Compatibility.h" #include @@ -30,11 +31,28 @@ { class IJobUnserializer; +#if ORTHANC_BUILDING_FRAMEWORK_LIBRARY == 1 + class JobOperationValue + { + /** + * This is for ABI compatibility with Orthanc framework <= 1.8.0, + * only to be able to run unit tests from Orthanc 1.7.2 to + * 1.8.0. The class was moved to "IJobOperationValue" in 1.8.1, + * and its memory layout has changed. Don't use this anymore. + **/ + }; +#endif + class ORTHANC_PUBLIC JobOperationValues : public boost::noncopyable { private: std::vector values_; +#if ORTHANC_BUILDING_FRAMEWORK_LIBRARY == 1 + // For binary compatibility with Orthanc <= 1.8.0 + void Append(JobOperationValue* value) ORTHANC_DEPRECATED; +#endif + void Append(JobOperationValues& target, bool clear); diff -r 3dffe8f7af48 -r 93c281752e7a OrthancFramework/Sources/JobsEngine/Operations/SequenceOfOperationsJob.cpp --- a/OrthancFramework/Sources/JobsEngine/Operations/SequenceOfOperationsJob.cpp Sun Dec 06 11:42:39 2020 +0100 +++ b/OrthancFramework/Sources/JobsEngine/Operations/SequenceOfOperationsJob.cpp Sun Dec 06 12:21:31 2020 +0100 @@ -236,6 +236,15 @@ } +#if ORTHANC_BUILDING_FRAMEWORK_LIBRARY == 1 + void SequenceOfOperationsJob::Lock::AddInput(size_t index, + const JobOperationValue& value) + { + throw OrthancException(ErrorCode_DiscontinuedAbi, "Removed in 1.8.1"); + } +#endif + + SequenceOfOperationsJob::Lock::Lock(SequenceOfOperationsJob& that) : that_(that), lock_(that.mutex_) diff -r 3dffe8f7af48 -r 93c281752e7a OrthancFramework/Sources/JobsEngine/Operations/SequenceOfOperationsJob.h --- a/OrthancFramework/Sources/JobsEngine/Operations/SequenceOfOperationsJob.h Sun Dec 06 11:42:39 2020 +0100 +++ b/OrthancFramework/Sources/JobsEngine/Operations/SequenceOfOperationsJob.h Sun Dec 06 12:21:31 2020 +0100 @@ -84,6 +84,11 @@ SequenceOfOperationsJob& that_; boost::mutex::scoped_lock lock_; +#if ORTHANC_BUILDING_FRAMEWORK_LIBRARY == 1 + void AddInput(size_t index, + const JobOperationValue& value) ORTHANC_DEPRECATED; +#endif + public: explicit Lock(SequenceOfOperationsJob& that);