changeset 5549:dcbf0c776945

fix jpeg
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 29 Mar 2024 23:23:01 +0100
parents ca8442691f16
children 28cc06e4859a 12d8a1a266e9 13eb84aea8b8
files OrthancFramework/Sources/Images/JpegWriter.cpp
diffstat 1 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancFramework/Sources/Images/JpegWriter.cpp	Fri Mar 29 21:53:41 2024 +0100
+++ b/OrthancFramework/Sources/Images/JpegWriter.cpp	Fri Mar 29 23:23:01 2024 +0100
@@ -177,7 +177,17 @@
     Internals::JpegErrorManager jerr;
 
     unsigned char* data = NULL;
-    unsigned long size;  // jpeg_mem_dest() uses "unsigned long*" instead of "size_t*"
+
+#if ((JPEG_LIB_VERSION_MAJOR < 9) ||                                    \
+     (JPEG_LIB_VERSION_MAJOR == 9 && JPEG_LIB_VERSION_MINOR <= 3))
+    /**
+     * jpeg_mem_dest() has "unsigned long*" as its 3rd parameter until
+     * jpeg-9c. Since jpeg-9d, this is a "size_t*".
+     **/
+    unsigned long size;
+#else
+    size_t size;
+#endif
 
     if (setjmp(jerr.GetJumpBuffer())) 
     {