# HG changeset patch # User Sebastien Jodogne # Date 1619080889 -7200 # Node ID 6b18d3fbee82684a88428e8ae26313f467ef23dd # Parent 5931c2ff22ca19954090c5ebe8c339fc509f5460 backward compatibility with Orthanc SDK 0.9.5 diff -r 5931c2ff22ca -r 6b18d3fbee82 Framework/Plugins/DatabaseBackendAdapterV2.cpp --- a/Framework/Plugins/DatabaseBackendAdapterV2.cpp Wed Apr 21 17:56:43 2021 +0200 +++ b/Framework/Plugins/DatabaseBackendAdapterV2.cpp Thu Apr 22 10:41:29 2021 +0200 @@ -1029,6 +1029,8 @@ } +#if defined(ORTHANC_PLUGINS_VERSION_IS_ABOVE) +# if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 4, 0) static OrthancPluginErrorCode LookupIdentifierRange(OrthancPluginDatabaseContext* context, void* payload, OrthancPluginResourceType resourceType, @@ -1059,6 +1061,8 @@ } ORTHANC_PLUGINS_DATABASE_CATCH; } +# endif +#endif static OrthancPluginErrorCode LookupMetadata(OrthancPluginDatabaseContext* context, @@ -1465,6 +1469,8 @@ #endif +#if defined(ORTHANC_PLUGINS_VERSION_IS_ABOVE) +# if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 5, 2) // New primitive since Orthanc 1.5.2 static OrthancPluginErrorCode GetChildrenMetadata(OrthancPluginDatabaseContext* context, void* payload, @@ -1494,8 +1500,12 @@ } ORTHANC_PLUGINS_DATABASE_CATCH; } +# endif +#endif +#if defined(ORTHANC_PLUGINS_VERSION_IS_ABOVE) +# if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 5, 2) // New primitive since Orthanc 1.5.2 static OrthancPluginErrorCode GetLastChangeIndex(int64_t* result, void* payload) @@ -1510,8 +1520,12 @@ } ORTHANC_PLUGINS_DATABASE_CATCH; } +# endif +#endif +#if defined(ORTHANC_PLUGINS_VERSION_IS_ABOVE) +# if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 5, 2) // New primitive since Orthanc 1.5.2 static OrthancPluginErrorCode TagMostRecentPatient(void* payload, int64_t patientId) @@ -1526,6 +1540,8 @@ } ORTHANC_PLUGINS_DATABASE_CATCH; } +# endif +#endif #if defined(ORTHANC_PLUGINS_VERSION_IS_ABOVE) // Macro introduced in 1.3.1 diff -r 5931c2ff22ca -r 6b18d3fbee82 Framework/Plugins/IndexBackend.cpp --- a/Framework/Plugins/IndexBackend.cpp Wed Apr 21 17:56:43 2021 +0200 +++ b/Framework/Plugins/IndexBackend.cpp Thu Apr 22 10:41:29 2021 +0200 @@ -2389,6 +2389,7 @@ #endif +#if ORTHANC_PLUGINS_HAS_DATABASE_CONSTRAINT == 1 void IndexBackend::CreateInstanceGeneric(OrthancPluginCreateInstanceResult& result, DatabaseManager& manager, const char* hashPatient, @@ -2505,6 +2506,7 @@ assert(result.seriesId != -1); assert(result.instanceId != -1); } +#endif void IndexBackend::Register(IndexBackend* backend, diff -r 5931c2ff22ca -r 6b18d3fbee82 Framework/Plugins/IndexBackend.h --- a/Framework/Plugins/IndexBackend.h Wed Apr 21 17:56:43 2021 +0200 +++ b/Framework/Plugins/IndexBackend.h Thu Apr 22 10:41:29 2021 +0200 @@ -358,6 +358,7 @@ } #endif +#if ORTHANC_PLUGINS_HAS_DATABASE_CONSTRAINT == 1 // This function corresponds to // "Orthanc::Compatibility::ICreateInstance::Apply()" void CreateInstanceGeneric(OrthancPluginCreateInstanceResult& result, @@ -366,6 +367,7 @@ const char* hashStudy, const char* hashSeries, const char* hashInstance); +#endif bool LookupGlobalIntegerProperty(int& target /*out*/, DatabaseManager& manager, diff -r 5931c2ff22ca -r 6b18d3fbee82 Framework/Plugins/StorageBackend.cpp --- a/Framework/Plugins/StorageBackend.cpp Wed Apr 21 17:56:43 2021 +0200 +++ b/Framework/Plugins/StorageBackend.cpp Thu Apr 22 10:41:29 2021 +0200 @@ -315,7 +315,8 @@ } -#if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 9, 0) +#if defined(ORTHANC_PLUGINS_VERSION_IS_ABOVE) +# if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 9, 0) static OrthancPluginErrorCode StorageReadWhole(OrthancPluginMemoryBuffer64* target, const char* uuid, OrthancPluginContentType type) @@ -492,6 +493,7 @@ } ORTHANC_PLUGINS_DATABASE_CATCH; } +# endif #endif