# HG changeset patch # User Sebastien Jodogne # Date 1725891274 -7200 # Node ID 3915736c40a55b5a421b81887af2089ac29c595c # Parent 247fc5368693790c1aca9d36660856ae9cd929e9# Parent db4bd2f9e8d20f6a39289e7d9023f232384a0ae7 merge diff -r db4bd2f9e8d2 -r 3915736c40a5 OrthancServer/CMakeLists.txt --- a/OrthancServer/CMakeLists.txt Mon Sep 09 16:05:13 2024 +0200 +++ b/OrthancServer/CMakeLists.txt Mon Sep 09 16:14:34 2024 +0200 @@ -332,7 +332,6 @@ add_definitions( -DORTHANC_BUILD_UNIT_TESTS=1 - -DORTHANC_BUILDING_SERVER_LIBRARY=1 # Macros for the plugins -DHAS_ORTHANC_EXCEPTION=0 diff -r db4bd2f9e8d2 -r 3915736c40a5 OrthancServer/Plugins/Samples/DelayedDeletion/CMakeLists.txt --- a/OrthancServer/Plugins/Samples/DelayedDeletion/CMakeLists.txt Mon Sep 09 16:05:13 2024 +0200 +++ b/OrthancServer/Plugins/Samples/DelayedDeletion/CMakeLists.txt Mon Sep 09 16:14:34 2024 +0200 @@ -60,7 +60,6 @@ -DORTHANC_PLUGIN_VERSION="${PLUGIN_VERSION}" -DORTHANC_ENABLE_LOGGING=1 -DORTHANC_ENABLE_PLUGINS=1 - -DORTHANC_BUILDING_SERVER_LIBRARY=0 ) include_directories( diff -r db4bd2f9e8d2 -r 3915736c40a5 OrthancServer/Resources/RunCppCheck.sh --- a/OrthancServer/Resources/RunCppCheck.sh Mon Sep 09 16:05:13 2024 +0200 +++ b/OrthancServer/Resources/RunCppCheck.sh Mon Sep 09 16:14:34 2024 +0200 @@ -55,7 +55,6 @@ -DJSONCPP_VERSION_MAJOR=1 \ -DJSONCPP_VERSION_MINOR=0 \ -DORTHANC_BUILDING_FRAMEWORK_LIBRARY=0 \ - -DORTHANC_BUILDING_SERVER_LIBRARY=1 \ -DORTHANC_BUILD_UNIT_TESTS=1 \ -DORTHANC_ENABLE_BASE64=1 \ -DORTHANC_ENABLE_CIVETWEB=1 \ diff -r db4bd2f9e8d2 -r 3915736c40a5 OrthancServer/Sources/Search/DatabaseConstraint.cpp --- a/OrthancServer/Sources/Search/DatabaseConstraint.cpp Mon Sep 09 16:05:13 2024 +0200 +++ b/OrthancServer/Sources/Search/DatabaseConstraint.cpp Mon Sep 09 16:14:34 2024 +0200 @@ -21,21 +21,10 @@ **/ -#if !defined(ORTHANC_BUILDING_SERVER_LIBRARY) -# error Macro ORTHANC_BUILDING_SERVER_LIBRARY must be defined -#endif - -#if ORTHANC_BUILDING_SERVER_LIBRARY == 1 -# include "../PrecompiledHeadersServer.h" -#endif - +#include "../PrecompiledHeadersServer.h" #include "DatabaseConstraint.h" -#if ORTHANC_BUILDING_SERVER_LIBRARY == 1 -# include "../../../OrthancFramework/Sources/OrthancException.h" -#else -# include -#endif +#include "../../../OrthancFramework/Sources/OrthancException.h" #include #include @@ -93,7 +82,7 @@ #endif -#if ORTHANC_PLUGINS_HAS_DATABASE_CONSTRAINT == 1 +#if ORTHANC_ENABLE_PLUGINS == 1 OrthancPluginConstraintType Convert(ConstraintType constraint) { switch (constraint) @@ -120,7 +109,7 @@ #endif -#if ORTHANC_PLUGINS_HAS_DATABASE_CONSTRAINT == 1 +#if ORTHANC_ENABLE_PLUGINS == 1 ConstraintType Convert(OrthancPluginConstraintType constraint) { switch (constraint) @@ -170,7 +159,7 @@ } -#if ORTHANC_PLUGINS_HAS_DATABASE_CONSTRAINT == 1 +#if ORTHANC_ENABLE_PLUGINS == 1 DatabaseConstraint::DatabaseConstraint(const OrthancPluginDatabaseConstraint& constraint) : level_(Plugins::Convert(constraint.level)), tag_(constraint.tagGroup, constraint.tagElement), @@ -222,7 +211,7 @@ } -#if ORTHANC_PLUGINS_HAS_DATABASE_CONSTRAINT == 1 +#if ORTHANC_ENABLE_PLUGINS == 1 void DatabaseConstraint::EncodeForPlugins(OrthancPluginDatabaseConstraint& constraint, std::vector& tmpValues) const { diff -r db4bd2f9e8d2 -r 3915736c40a5 OrthancServer/Sources/Search/DatabaseConstraint.h --- a/OrthancServer/Sources/Search/DatabaseConstraint.h Mon Sep 09 16:05:13 2024 +0200 +++ b/OrthancServer/Sources/Search/DatabaseConstraint.h Mon Sep 09 16:14:34 2024 +0200 @@ -23,28 +23,11 @@ #pragma once -#if !defined(ORTHANC_BUILDING_SERVER_LIBRARY) -# error Macro ORTHANC_BUILDING_SERVER_LIBRARY must be defined -#endif - -#if ORTHANC_BUILDING_SERVER_LIBRARY == 1 -# include "../../../OrthancFramework/Sources/DicomFormat/DicomMap.h" -#else -// This is for the "orthanc-databases" project to reuse this file -# include +#if ORTHANC_ENABLE_PLUGINS == 1 +# include "../../Plugins/Include/orthanc/OrthancCDatabasePlugin.h" #endif -#define ORTHANC_PLUGINS_HAS_DATABASE_CONSTRAINT 0 - -#if ORTHANC_ENABLE_PLUGINS == 1 -# include -# if defined(ORTHANC_PLUGINS_VERSION_IS_ABOVE) // Macro introduced in 1.3.1 -# if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 5, 2) -# undef ORTHANC_PLUGINS_HAS_DATABASE_CONSTRAINT -# define ORTHANC_PLUGINS_HAS_DATABASE_CONSTRAINT 1 -# endif -# endif -#endif +#include "../../../OrthancFramework/Sources/DicomFormat/DicomMap.h" #include @@ -59,27 +42,21 @@ ConstraintType_List }; + +#if ORTHANC_ENABLE_PLUGINS == 1 namespace Plugins { -#if ORTHANC_ENABLE_PLUGINS == 1 OrthancPluginResourceType Convert(ResourceType type); -#endif + + ResourceType Convert(OrthancPluginResourceType type); -#if ORTHANC_ENABLE_PLUGINS == 1 - ResourceType Convert(OrthancPluginResourceType type); + OrthancPluginConstraintType Convert(ConstraintType constraint); + + ConstraintType Convert(OrthancPluginConstraintType constraint); + } #endif -#if ORTHANC_PLUGINS_HAS_DATABASE_CONSTRAINT == 1 - OrthancPluginConstraintType Convert(ConstraintType constraint); -#endif -#if ORTHANC_PLUGINS_HAS_DATABASE_CONSTRAINT == 1 - ConstraintType Convert(OrthancPluginConstraintType constraint); -#endif - } - - - // This class is also used by the "orthanc-databases" project class DatabaseConstraint : public boost::noncopyable { private: @@ -100,7 +77,7 @@ bool caseSensitive, bool mandatory); -#if ORTHANC_PLUGINS_HAS_DATABASE_CONSTRAINT == 1 +#if ORTHANC_ENABLE_PLUGINS == 1 explicit DatabaseConstraint(const OrthancPluginDatabaseConstraint& constraint); #endif @@ -145,7 +122,7 @@ bool IsMatch(const DicomMap& dicom) const; -#if ORTHANC_PLUGINS_HAS_DATABASE_CONSTRAINT == 1 +#if ORTHANC_ENABLE_PLUGINS == 1 void EncodeForPlugins(OrthancPluginDatabaseConstraint& constraint, std::vector& tmpValues) const; #endif diff -r db4bd2f9e8d2 -r 3915736c40a5 OrthancServer/Sources/Search/ISqlLookupFormatter.cpp --- a/OrthancServer/Sources/Search/ISqlLookupFormatter.cpp Mon Sep 09 16:05:13 2024 +0200 +++ b/OrthancServer/Sources/Search/ISqlLookupFormatter.cpp Mon Sep 09 16:14:34 2024 +0200 @@ -21,25 +21,12 @@ **/ -#if !defined(ORTHANC_BUILDING_SERVER_LIBRARY) -# error Macro ORTHANC_BUILDING_SERVER_LIBRARY must be defined -#endif - -#if ORTHANC_BUILDING_SERVER_LIBRARY == 1 -# include "../PrecompiledHeadersServer.h" -#endif - +#include "../PrecompiledHeadersServer.h" #include "ISqlLookupFormatter.h" -#if ORTHANC_BUILDING_SERVER_LIBRARY == 1 -# include "../../../OrthancFramework/Sources/OrthancException.h" -# include "../../../OrthancFramework/Sources/Toolbox.h" -# include "../Database/FindRequest.h" -#else -# include -# include -#endif - +#include "../../../OrthancFramework/Sources/OrthancException.h" +#include "../../../OrthancFramework/Sources/Toolbox.h" +#include "../Database/FindRequest.h" #include "DatabaseConstraint.h" #include @@ -617,7 +604,7 @@ } } -#if ORTHANC_BUILDING_SERVER_LIBRARY == 1 + void ISqlLookupFormatter::Apply(std::string& sql, ISqlLookupFormatter& formatter, const FindRequest& request) @@ -754,9 +741,7 @@ { sql += formatter.FormatLimits(request.GetLimitsSince(), request.GetLimitsCount()); } - } -#endif void ISqlLookupFormatter::ApplySingleLevel(std::string& sql, @@ -872,5 +857,4 @@ sql += " LIMIT " + boost::lexical_cast(limit); } } - } diff -r db4bd2f9e8d2 -r 3915736c40a5 OrthancServer/Sources/Search/ISqlLookupFormatter.h --- a/OrthancServer/Sources/Search/ISqlLookupFormatter.h Mon Sep 09 16:05:13 2024 +0200 +++ b/OrthancServer/Sources/Search/ISqlLookupFormatter.h Mon Sep 09 16:14:34 2024 +0200 @@ -23,11 +23,7 @@ #pragma once -#if ORTHANC_BUILDING_SERVER_LIBRARY == 1 -# include "../../../OrthancFramework/Sources/Enumerations.h" -#else -# include -#endif +#include "../../../OrthancFramework/Sources/Enumerations.h" #include #include @@ -44,7 +40,6 @@ LabelsConstraint_None }; - // This class is also used by the "orthanc-databases" project class ISqlLookupFormatter : public boost::noncopyable { public: @@ -88,10 +83,8 @@ LabelsConstraint labelsConstraint, // New in Orthanc 1.12.0 size_t limit); -#if ORTHANC_BUILDING_SERVER_LIBRARY == 1 static void Apply(std::string& sql, ISqlLookupFormatter& formatter, const FindRequest& request); -#endif }; }