changeset 5936:433e89edb3a0

merge
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 16 Dec 2024 18:35:27 +0100
parents c4c0640577fb (diff) 892ee42584bb (current diff)
children 4bd7e199a5e1
files
diffstat 2 files changed, 20 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancFramework/Sources/DicomNetworking/Internals/DicomTls.cpp	Mon Dec 16 18:09:11 2024 +0100
+++ b/OrthancFramework/Sources/DicomNetworking/Internals/DicomTls.cpp	Mon Dec 16 18:35:27 2024 +0100
@@ -44,6 +44,16 @@
 #endif
 
 
+#if ORTHANC_ENABLE_PLUGINS == 1
+#  if defined(__ORTHANC_FILE__)
+//   Prevents the system-wide DCMTK library from leaking the
+//   full path of this source file in "DCMTLS_ERROR()"
+#    undef __FILE__
+#    define __FILE__ __ORTHANC_FILE__
+#  endif
+#endif
+
+
 namespace Orthanc
 {
   namespace Internals
--- a/OrthancServer/Resources/PreventProtobufDirectoryLeaks.py	Mon Dec 16 18:09:11 2024 +0100
+++ b/OrthancServer/Resources/PreventProtobufDirectoryLeaks.py	Mon Dec 16 18:35:27 2024 +0100
@@ -29,13 +29,21 @@
 with open(sys.argv[1], 'r') as f:
     s = f.read()
 
-s = s.replace('__FILE__', '__ORTHANC_FILE__')
+if False:
+    # This was the version in Orthanc 1.12.4, doesn't seem to work anymore
+    s = s.replace('__FILE__', '__ORTHANC_FILE__')
 
-s = """
+    s = """
 #if !defined(__ORTHANC_FILE__)
 #  define __ORTHANC_FILE__ __FILE__
 #endif
 """ + s
+else:
+    # New version in Orthanc 1.12.5
+    s = """
+#undef __FILE__
+#define __FILE__ __ORTHANC_FILE__
+""" + s
 
 with open(sys.argv[1], 'w') as f:
     f.write(s)