view Resources/Patches/dcmtk-3.6.4.patch @ 3593:0301f59450fe

improved the patch for loading DICOM dictionary from memory
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 06 Jan 2020 17:58:15 +0100
parents ea54109a7312
children f2df51bff2fd
line wrap: on
line source

diff -urEb dcmtk-3.6.4.orig/dcmdata/include/dcmtk/dcmdata/dcdict.h dcmtk-3.6.4/dcmdata/include/dcmtk/dcmdata/dcdict.h
--- dcmtk-3.6.4.orig/dcmdata/include/dcmtk/dcmdata/dcdict.h	2020-01-06 17:38:11.323628123 +0100
+++ dcmtk-3.6.4/dcmdata/include/dcmtk/dcmdata/dcdict.h	2020-01-06 17:39:29.519603910 +0100
@@ -152,6 +152,12 @@
     /// returns an iterator to the end of the repeating tag dictionary
     DcmDictEntryListIterator repeatingEnd() { return repDict.end(); }
 
+    // Function by the Orthanc project to load a dictionary from a
+    // memory buffer, which is necessary in sandboxed
+    // environments. This is an adapted version of
+    // DcmDataDictionary::loadDictionary().
+    OFBool loadFromMemory(const std::string& content, OFBool errorIfAbsent = OFTrue);
+
 private:
 
     /** private undefined assignment operator
diff -urEb dcmtk-3.6.4.orig/dcmdata/libsrc/dcdict.cc dcmtk-3.6.4/dcmdata/libsrc/dcdict.cc
--- dcmtk-3.6.4.orig/dcmdata/libsrc/dcdict.cc	2020-01-06 17:38:11.327628121 +0100
+++ dcmtk-3.6.4/dcmdata/libsrc/dcdict.cc	2020-01-06 17:39:58.927594760 +0100
@@ -899,3 +899,6 @@
   wrlock().clear();
   wrunlock();
 }
+
+
+#include "dcdict_orthanc.cc"
diff -urEb dcmtk-3.6.4.orig/dcmdata/libsrc/dcpxitem.cc dcmtk-3.6.4/dcmdata/libsrc/dcpxitem.cc
--- dcmtk-3.6.4.orig/dcmdata/libsrc/dcpxitem.cc	2020-01-06 17:38:11.327628121 +0100
+++ dcmtk-3.6.4/dcmdata/libsrc/dcpxitem.cc	2020-01-06 17:38:14.195627236 +0100
@@ -36,6 +36,9 @@
 #include "dcmtk/dcmdata/dcostrma.h"    /* for class DcmOutputStream */
 #include "dcmtk/dcmdata/dcwcache.h"    /* for class DcmWriteCache */
 
+#undef max
+#include "dcmtk/ofstd/oflimits.h"
+
 
 // ********************************
 
diff -urEb dcmtk-3.6.4.orig/ofstd/include/dcmtk/ofstd/offile.h dcmtk-3.6.4/ofstd/include/dcmtk/ofstd/offile.h
--- dcmtk-3.6.4.orig/ofstd/include/dcmtk/ofstd/offile.h	2020-01-06 17:38:11.371628108 +0100
+++ dcmtk-3.6.4/ofstd/include/dcmtk/ofstd/offile.h	2020-01-06 17:38:14.195627236 +0100
@@ -575,7 +575,7 @@
    */
   void setlinebuf()
   {
-#if defined(_WIN32) || defined(__hpux)
+#if defined(_WIN32) || defined(__hpux) || defined(__LSB_VERSION__)
     this->setvbuf(NULL, _IOLBF, 0);
 #else
     :: setlinebuf(file_);