changeset 3963:3b0c555f16a3

fix msvc2008
author s.jodogne@gmail.com
date Thu, 21 May 2020 10:47:58 +0200
parents d30eb4ae5bb6
children 821715370890
files OrthancServer/OrthancGetRequestHandler.cpp Plugins/Include/orthanc/OrthancCPlugin.h Plugins/Samples/Common/OrthancPluginCppWrapper.h
diffstat 3 files changed, 16 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancServer/OrthancGetRequestHandler.cpp	Wed May 20 20:53:59 2020 +0200
+++ b/OrthancServer/OrthancGetRequestHandler.cpp	Thu May 21 10:47:58 2020 +0200
@@ -33,13 +33,6 @@
 #include "PrecompiledHeadersServer.h"
 #include "OrthancGetRequestHandler.h"
 
-#include <dcmtk/dcmdata/dcdeftag.h>
-#include <dcmtk/dcmdata/dcfilefo.h>
-#include <dcmtk/dcmdata/dcistrmb.h>
-#include <dcmtk/dcmnet/assoc.h>
-#include <dcmtk/dcmnet/dimse.h>
-#include <dcmtk/dcmnet/diutil.h>
-
 #include "../../Core/DicomParsing/FromDcmtkBridge.h"
 #include "../Core/DicomFormat/DicomArray.h"
 #include "../Core/Logging.h"
@@ -48,9 +41,16 @@
 #include "ServerContext.h"
 #include "ServerJobs/DicomModalityStoreJob.h"
 
+#include <dcmtk/dcmdata/dcdeftag.h>
+#include <dcmtk/dcmdata/dcfilefo.h>
+#include <dcmtk/dcmdata/dcistrmb.h>
+#include <dcmtk/dcmnet/assoc.h>
+#include <dcmtk/dcmnet/dimse.h>
+#include <dcmtk/dcmnet/diutil.h>
+#include <dcmtk/ofstd/ofstring.h>
+
 #include <sstream>  // For std::stringstream
 
-
 namespace Orthanc
 {
   namespace
@@ -397,9 +397,13 @@
     
     if (stDetail.get() != NULL)
     {
+      // It is impossible to directly use the "<<" stream construct
+      // with "DcmObject::PrintHelper" using MSVC2008
       std::stringstream s;
-      s << DcmObject::PrintHelper(*stDetail);
-      LOG(INFO) << "  Status Detail:" << OFendl << s.str();
+      DcmObject::PrintHelper obj(*stDetail);
+      obj.dcmobj_.print(s);
+
+      LOG(INFO) << "  Status Detail: " << s.str();
     }
     
     return cond;
--- a/Plugins/Include/orthanc/OrthancCPlugin.h	Wed May 20 20:53:59 2020 +0200
+++ b/Plugins/Include/orthanc/OrthancCPlugin.h	Thu May 21 10:47:58 2020 +0200
@@ -7696,7 +7696,7 @@
     }
     else
     {
-      return hasPixelData;
+      return (hasPixelData != 0);
     }
   }
 
--- a/Plugins/Samples/Common/OrthancPluginCppWrapper.h	Wed May 20 20:53:59 2020 +0200
+++ b/Plugins/Samples/Common/OrthancPluginCppWrapper.h	Thu May 21 10:47:58 2020 +0200
@@ -1181,7 +1181,7 @@
 
     size_t GetSize() const
     {
-      return OrthancPluginGetInstanceSize(GetGlobalContext(), instance_);
+      return static_cast<size_t>(OrthancPluginGetInstanceSize(GetGlobalContext(), instance_));
     }
 
     void GetJson(Json::Value& target) const;