changeset 4350:e457c30970cf

fix ORTHANC_DEPRECATED macro for C++14
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sun, 06 Dec 2020 13:16:27 +0100
parents 85237ae3a076
children d300ace4acad
files OrthancFramework/Sources/Compatibility.h OrthancFramework/Sources/DicomFormat/DicomTag.h OrthancFramework/Sources/HttpServer/HttpToolbox.h OrthancFramework/Sources/JobsEngine/Operations/JobOperationValues.h OrthancFramework/Sources/JobsEngine/Operations/SequenceOfOperationsJob.h
diffstat 5 files changed, 31 insertions(+), 35 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancFramework/Sources/Compatibility.h	Sun Dec 06 12:47:54 2020 +0100
+++ b/OrthancFramework/Sources/Compatibility.h	Sun Dec 06 13:16:27 2020 +0100
@@ -34,12 +34,12 @@
 
 
 // Macro "ORTHANC_DEPRECATED" tags a function as having been deprecated
-#if __cplusplus >= 201402L   // C++14
-#  define ORTHANC_DEPRECATED [[deprecated]]
+#if (__cplusplus >= 201402L)  // C++14
+#  define ORTHANC_DEPRECATED(f) [[deprecated]] f
 #elif defined(__GNUC__) || defined(__clang__)
-#  define ORTHANC_DEPRECATED __attribute__((deprecated))
+#  define ORTHANC_DEPRECATED(f) f __attribute__((deprecated))
 #elif defined(_MSC_VER)
-#  define ORTHANC_DEPRECATED __declspec(deprecated)
+#  define ORTHANC_DEPRECATED(f) f __declspec(deprecated)
 #else
 #  define ORTHANC_DEPRECATED
 #endif
--- a/OrthancFramework/Sources/DicomFormat/DicomTag.h	Sun Dec 06 12:47:54 2020 +0100
+++ b/OrthancFramework/Sources/DicomFormat/DicomTag.h	Sun Dec 06 13:16:27 2020 +0100
@@ -74,7 +74,7 @@
                                  DicomModule module);
 
 #if ORTHANC_BUILDING_FRAMEWORK_LIBRARY == 1
-    ORTHANC_PUBLIC friend std::ostream& operator<< (std::ostream& o, const DicomTag& tag) ORTHANC_DEPRECATED;
+    ORTHANC_PUBLIC ORTHANC_DEPRECATED(friend std::ostream& operator<<(std::ostream& o, const DicomTag& tag));
 #endif
   };
 
--- a/OrthancFramework/Sources/HttpServer/HttpToolbox.h	Sun Dec 06 12:47:54 2020 +0100
+++ b/OrthancFramework/Sources/HttpServer/HttpToolbox.h	Sun Dec 06 13:16:27 2020 +0100
@@ -62,36 +62,32 @@
                                     const GetArguments& source);
 
 #if (ORTHANC_ENABLE_MONGOOSE == 1 || ORTHANC_ENABLE_CIVETWEB == 1)
-    ORTHANC_DEPRECATED
-    static bool SimpleGet(std::string& result,
-                          IHttpHandler& handler,
-                          RequestOrigin origin,
-                          const std::string& uri,
-                          const Arguments& httpHeaders);
+    ORTHANC_DEPRECATED(static bool SimpleGet(std::string& result,
+                                             IHttpHandler& handler,
+                                             RequestOrigin origin,
+                                             const std::string& uri,
+                                             const Arguments& httpHeaders));
 
-    ORTHANC_DEPRECATED
-    static bool SimplePost(std::string& result,
-                           IHttpHandler& handler,
-                           RequestOrigin origin,
-                           const std::string& uri,
-                           const void* bodyData,
-                           size_t bodySize,
-                           const Arguments& httpHeaders);
+    ORTHANC_DEPRECATED(static bool SimplePost(std::string& result,
+                                              IHttpHandler& handler,
+                                              RequestOrigin origin,
+                                              const std::string& uri,
+                                              const void* bodyData,
+                                              size_t bodySize,
+                                              const Arguments& httpHeaders));
 
-    ORTHANC_DEPRECATED
-    static bool SimplePut(std::string& result,
-                          IHttpHandler& handler,
-                          RequestOrigin origin,
-                          const std::string& uri,
-                          const void* bodyData,
-                          size_t bodySize,
-                          const Arguments& httpHeaders);
+    ORTHANC_DEPRECATED(static bool SimplePut(std::string& result,
+                                             IHttpHandler& handler,
+                                             RequestOrigin origin,
+                                             const std::string& uri,
+                                             const void* bodyData,
+                                             size_t bodySize,
+                                             const Arguments& httpHeaders));
 
-    ORTHANC_DEPRECATED
-    static bool SimpleDelete(IHttpHandler& handler,
-                             RequestOrigin origin,
-                             const std::string& uri,
-                             const Arguments& httpHeaders);
+    ORTHANC_DEPRECATED(static bool SimpleDelete(IHttpHandler& handler,
+                                                RequestOrigin origin,
+                                                const std::string& uri,
+                                                const Arguments& httpHeaders));
 #endif
   };
 }
--- a/OrthancFramework/Sources/JobsEngine/Operations/JobOperationValues.h	Sun Dec 06 12:47:54 2020 +0100
+++ b/OrthancFramework/Sources/JobsEngine/Operations/JobOperationValues.h	Sun Dec 06 13:16:27 2020 +0100
@@ -50,7 +50,7 @@
 
 #if ORTHANC_BUILDING_FRAMEWORK_LIBRARY == 1
     // For binary compatibility with Orthanc <= 1.8.0
-    void Append(JobOperationValue* value) ORTHANC_DEPRECATED;
+    ORTHANC_DEPRECATED(void Append(JobOperationValue* value));
 #endif
     
     void Append(JobOperationValues& target,
--- a/OrthancFramework/Sources/JobsEngine/Operations/SequenceOfOperationsJob.h	Sun Dec 06 12:47:54 2020 +0100
+++ b/OrthancFramework/Sources/JobsEngine/Operations/SequenceOfOperationsJob.h	Sun Dec 06 13:16:27 2020 +0100
@@ -85,8 +85,8 @@
       boost::mutex::scoped_lock  lock_;
 
 #if ORTHANC_BUILDING_FRAMEWORK_LIBRARY == 1
-      void AddInput(size_t index,
-                    const JobOperationValue& value) ORTHANC_DEPRECATED;
+      ORTHANC_DEPRECATED(void AddInput(size_t index,
+                                       const JobOperationValue& value));
 #endif
       
     public: