diff -urEb dcmtk-3.6.9.orig/config/math.cc dcmtk-3.6.9/config/math.cc
--- dcmtk-3.6.9.orig/config/math.cc	2025-02-18 18:03:13.501406015 +0100
+++ dcmtk-3.6.9/config/math.cc	2025-02-18 18:05:52.950086576 +0100
@@ -42,11 +42,17 @@
 #include <windows.h>
 #endif
 
+#if defined(_MSC_VER)
+#include <float.h>
+#endif
+
 struct dcmtk_config_math
 {
   static inline OFBool isnan( float f )
   {
-#ifdef HAVE_PROTOTYPE_STD__ISNAN
+#if defined(_MSC_VER)
+    return _isnan(static_cast<double>(f)) != 0;
+#elif defined(HAVE_PROTOTYPE_STD__ISNAN)
     return STD_NAMESPACE isnan(f);
 #else
     return ::isnan(f);
@@ -55,7 +61,9 @@
 
   static inline OFBool isnan( double d )
   {
-#ifdef HAVE_PROTOTYPE_STD__ISNAN
+#if defined(_MSC_VER)
+    return _isnan(d) != 0;
+#elif defined(HAVE_PROTOTYPE_STD__ISNAN)
     return STD_NAMESPACE isnan(d);
 #else
     return ::isnan(d);
@@ -64,7 +72,9 @@
 
   static inline OFBool isinf( float f )
   {
-#ifdef HAVE_PROTOTYPE_STD__ISINF
+#if defined(_MSC_VER)
+    return _finite(static_cast<double>(f)) != 0;
+#elif defined(HAVE_PROTOTYPE_STD__ISINF)
     return STD_NAMESPACE isinf( f );
 #else
     return ::isinf( f );
@@ -73,7 +83,9 @@
 
   static inline OFBool isinf( double d )
   {
-#ifdef HAVE_PROTOTYPE_STD__ISINF
+#if defined(_MSC_VER)
+    return _finite(d) != 0;
+#elif defined(HAVE_PROTOTYPE_STD__ISINF)
     return STD_NAMESPACE isinf( d );
 #else
     return ::isinf( d );
diff -urEb dcmtk-3.6.9.orig/dcmjpeg/libijg12/jccoefct.c dcmtk-3.6.9/dcmjpeg/libijg12/jccoefct.c
--- dcmtk-3.6.9.orig/dcmjpeg/libijg12/jccoefct.c	2025-02-18 18:03:13.530405562 +0100
+++ dcmtk-3.6.9/dcmjpeg/libijg12/jccoefct.c	2025-02-18 18:05:52.950086576 +0100
@@ -343,7 +343,7 @@
 METHODDEF(boolean)
 compress_output (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
 {
-  (void)input_buf;
+  //(void)input_buf;
   j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec;
   c_coef_ptr coef = (c_coef_ptr) lossyc->coef_private;
   JDIMENSION MCU_col_num;   /* index of current MCU within row */
diff -urEb dcmtk-3.6.9.orig/dcmjpeg/libijg12/jcdiffct.c dcmtk-3.6.9/dcmjpeg/libijg12/jcdiffct.c
--- dcmtk-3.6.9.orig/dcmjpeg/libijg12/jcdiffct.c	2025-02-18 18:03:13.531405546 +0100
+++ dcmtk-3.6.9/dcmjpeg/libijg12/jcdiffct.c	2025-02-18 18:05:52.951086562 +0100
@@ -302,7 +302,7 @@
 METHODDEF(boolean)
 compress_output (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
 {
-  (void)input_buf;
+  //(void)input_buf;
   j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec;
   c_diff_ptr diff = (c_diff_ptr) losslsc->diff_private;
   /* JDIMENSION MCU_col_num; */ /* index of current MCU within row */
diff -urEb dcmtk-3.6.9.orig/dcmjpeg/libijg12/jcpred.c dcmtk-3.6.9/dcmjpeg/libijg12/jcpred.c
--- dcmtk-3.6.9.orig/dcmjpeg/libijg12/jcpred.c	2025-02-18 18:03:13.530405562 +0100
+++ dcmtk-3.6.9/dcmjpeg/libijg12/jcpred.c	2025-02-18 18:05:52.951086562 +0100
@@ -213,7 +213,7 @@
          const JSAMPROW input_buf, JSAMPROW prev_row,
          JDIFFROW diff_buf, JDIMENSION width)
 {
-  (void)prev_row;
+  //(void)prev_row;
   DIFFERENCE_1D(INITIAL_PREDICTORx);
 
   /*
diff -urEb dcmtk-3.6.9.orig/dcmjpeg/libijg12/jctrans.c dcmtk-3.6.9/dcmjpeg/libijg12/jctrans.c
--- dcmtk-3.6.9.orig/dcmjpeg/libijg12/jctrans.c	2025-02-18 18:03:13.530405562 +0100
+++ dcmtk-3.6.9/dcmjpeg/libijg12/jctrans.c	2025-02-18 18:05:52.951086562 +0100
@@ -267,7 +267,7 @@
 METHODDEF(boolean)
 compress_output (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
 {
-  (void)input_buf;
+  //(void)input_buf;
   j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec;
   c_coef_ptr coef = (c_coef_ptr) lossyc->coef_private;
   JDIMENSION MCU_col_num;   /* index of current MCU within row */
diff -urEb dcmtk-3.6.9.orig/dcmjpeg/libijg12/jdmerge.c dcmtk-3.6.9/dcmjpeg/libijg12/jdmerge.c
--- dcmtk-3.6.9.orig/dcmjpeg/libijg12/jdmerge.c	2025-02-18 18:03:13.530405562 +0100
+++ dcmtk-3.6.9/dcmjpeg/libijg12/jdmerge.c	2025-02-18 18:05:52.951086562 +0100
@@ -148,7 +148,7 @@
             JDIMENSION out_rows_avail)
 /* 2:1 vertical sampling case: may need a spare row. */
 {
-  (void) in_row_groups_avail;
+  //(void) in_row_groups_avail;
   my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
   JSAMPROW work_ptrs[2];
   JDIMENSION num_rows;      /* number of rows returned to caller */
@@ -198,8 +198,8 @@
             JDIMENSION out_rows_avail)
 /* 1:1 vertical sampling case: much easier, never need a spare row. */
 {
-  (void) in_row_groups_avail;
-  (void) out_rows_avail;
+  //(void) in_row_groups_avail;
+  //(void) out_rows_avail;
   my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
 
   /* Just do the upsampling. */
diff -urEb dcmtk-3.6.9.orig/dcmjpeg/libijg12/jdpostct.c dcmtk-3.6.9/dcmjpeg/libijg12/jdpostct.c
--- dcmtk-3.6.9.orig/dcmjpeg/libijg12/jdpostct.c	2025-02-18 18:03:13.530405562 +0100
+++ dcmtk-3.6.9/dcmjpeg/libijg12/jdpostct.c	2025-02-18 18:05:52.952086549 +0100
@@ -161,8 +161,8 @@
               JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
               JDIMENSION out_rows_avail)
 {
-  (void) output_buf;
-  (void) out_rows_avail;
+  //(void) output_buf;
+  //(void) out_rows_avail;
   my_post_ptr post = (my_post_ptr) cinfo->post;
   JDIMENSION old_next_row, num_rows;
 
@@ -207,9 +207,9 @@
             JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
             JDIMENSION out_rows_avail)
 {
-  (void) input_buf;
-  (void) in_row_group_ctr;
-  (void) in_row_groups_avail;
+  //(void) input_buf;
+  //(void) in_row_group_ctr;
+  //(void) in_row_groups_avail;
 
   my_post_ptr post = (my_post_ptr) cinfo->post;
   JDIMENSION num_rows, max_rows;
diff -urEb dcmtk-3.6.9.orig/dcmjpeg/libijg12/jdpred.c dcmtk-3.6.9/dcmjpeg/libijg12/jdpred.c
--- dcmtk-3.6.9.orig/dcmjpeg/libijg12/jdpred.c	2025-02-18 18:03:13.530405562 +0100
+++ dcmtk-3.6.9/dcmjpeg/libijg12/jdpred.c	2025-02-18 18:05:52.952086549 +0100
@@ -101,8 +101,8 @@
            const JDIFFROW diff_buf, const JDIFFROW prev_row,
            JDIFFROW undiff_buf, JDIMENSION width)
 {
-  (void)cinfo;
-  (void)comp_index;
+  //(void)cinfo;
+  //(void)comp_index;
   UNDIFFERENCE_1D(INITIAL_PREDICTOR2);
 }
 
@@ -111,8 +111,8 @@
            const JDIFFROW diff_buf, const JDIFFROW prev_row,
            JDIFFROW undiff_buf, JDIMENSION width)
 {
-  (void)cinfo;
-  (void)comp_index;
+  //(void)cinfo;
+  //(void)comp_index;
   UNDIFFERENCE_2D(PREDICTOR2);
   JPEG_UNUSED(Rc);
   JPEG_UNUSED(Rb);
@@ -123,8 +123,8 @@
            const JDIFFROW diff_buf, const JDIFFROW prev_row,
            JDIFFROW undiff_buf, JDIMENSION width)
 {
-  (void)cinfo;
-  (void)comp_index;
+  //(void)cinfo;
+  //(void)comp_index;
   UNDIFFERENCE_2D(PREDICTOR3);
   JPEG_UNUSED(Rc);
   JPEG_UNUSED(Rb);
@@ -135,8 +135,8 @@
            const JDIFFROW diff_buf, const JDIFFROW prev_row,
            JDIFFROW undiff_buf, JDIMENSION width)
 {
-  (void)cinfo;
-  (void)comp_index;
+  //(void)cinfo;
+  //(void)comp_index;
   UNDIFFERENCE_2D(PREDICTOR4);
   JPEG_UNUSED(Rc);
   JPEG_UNUSED(Rb);
@@ -147,8 +147,8 @@
            const JDIFFROW diff_buf, const JDIFFROW prev_row,
            JDIFFROW undiff_buf, JDIMENSION width)
 {
-  (void)cinfo;
-  (void)comp_index;
+  //(void)cinfo;
+  //(void)comp_index;
   SHIFT_TEMPS
   UNDIFFERENCE_2D(PREDICTOR5);
   JPEG_UNUSED(Rc);
@@ -160,8 +160,8 @@
            const JDIFFROW diff_buf, const JDIFFROW prev_row,
            JDIFFROW undiff_buf, JDIMENSION width)
 {
-  (void)cinfo;
-  (void)comp_index;
+  //(void)cinfo;
+  //(void)comp_index;
   SHIFT_TEMPS
   UNDIFFERENCE_2D(PREDICTOR6);
   JPEG_UNUSED(Rc);
@@ -173,8 +173,8 @@
            const JDIFFROW diff_buf, const JDIFFROW prev_row,
            JDIFFROW undiff_buf, JDIMENSION width)
 {
-  (void)cinfo;
-  (void)comp_index;
+  //(void)cinfo;
+  //(void)comp_index;
   SHIFT_TEMPS
   UNDIFFERENCE_2D(PREDICTOR7);
   JPEG_UNUSED(Rc);
@@ -195,7 +195,7 @@
                 JDIFFROW undiff_buf, JDIMENSION width)
 {
 
-  (void)prev_row;
+  //(void)prev_row;
   j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec;
 
   UNDIFFERENCE_1D(INITIAL_PREDICTORx);
diff -urEb dcmtk-3.6.9.orig/dcmjpeg/libijg12/jdsample.c dcmtk-3.6.9/dcmjpeg/libijg12/jdsample.c
--- dcmtk-3.6.9.orig/dcmjpeg/libijg12/jdsample.c	2025-02-18 18:03:13.530405562 +0100
+++ dcmtk-3.6.9/dcmjpeg/libijg12/jdsample.c	2025-02-18 18:05:52.952086549 +0100
@@ -92,7 +92,7 @@
           JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
           JDIMENSION out_rows_avail)
 {
-  (void)in_row_groups_avail;
+  //(void)in_row_groups_avail;
   my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
   int ci;
   jpeg_component_info * compptr;
@@ -158,8 +158,8 @@
 fullsize_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,
            JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)
 {
-  (void)cinfo;
-  (void)compptr;
+  //(void)cinfo;
+  //(void)compptr;
   *output_data_ptr = input_data;
 }
 
@@ -173,9 +173,9 @@
 noop_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,
            JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)
 {
-  (void)cinfo;
-  (void)compptr;
-  (void)input_data;
+  //(void)cinfo;
+  //(void)compptr;
+  //(void)input_data;
   *output_data_ptr = NULL;  /* safety check */
 }
 
@@ -239,7 +239,7 @@
 h2v1_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,
            JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)
 {
-  (void)compptr;
+  //(void)compptr;
   JSAMPARRAY output_data = *output_data_ptr;
   register JSAMPROW inptr, outptr;
   register JSAMPLE invalue;
@@ -268,7 +268,7 @@
 h2v2_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,
            JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)
 {
-  (void)compptr;
+  //(void)compptr;
   JSAMPARRAY output_data = *output_data_ptr;
   register JSAMPROW inptr, outptr;
   register JSAMPLE invalue;
diff -urEb dcmtk-3.6.9.orig/dcmjpeg/libijg12/jdscale.c dcmtk-3.6.9/dcmjpeg/libijg12/jdscale.c
--- dcmtk-3.6.9.orig/dcmjpeg/libijg12/jdscale.c	2025-02-18 18:03:13.530405562 +0100
+++ dcmtk-3.6.9/dcmjpeg/libijg12/jdscale.c	2025-02-18 18:05:52.953086535 +0100
@@ -67,7 +67,7 @@
 	const JDIFFROW diff_buf, JSAMPROW output_buf,
 	JDIMENSION width)
 {
-  (void)cinfo;
+  //(void)cinfo;
   unsigned int xindex;
 
   for (xindex = 0; xindex < width; xindex++)
diff -urEb dcmtk-3.6.9.orig/dcmjpeg/libijg12/jerror.c dcmtk-3.6.9/dcmjpeg/libijg12/jerror.c
--- dcmtk-3.6.9.orig/dcmjpeg/libijg12/jerror.c	2025-02-18 18:03:13.530405562 +0100
+++ dcmtk-3.6.9/dcmjpeg/libijg12/jerror.c	2025-02-18 18:05:52.953086535 +0100
@@ -34,6 +34,10 @@
 #define EXIT_FAILURE  1
 #endif
 
+#if defined(_MSC_VER) && _MSC_VER < 1900
+#define snprintf _snprintf
+#endif
+
 
 /*
  * Create the message string table.
diff -urEb dcmtk-3.6.9.orig/dcmjpeg/libijg12/jquant1.c dcmtk-3.6.9/dcmjpeg/libijg12/jquant1.c
--- dcmtk-3.6.9.orig/dcmjpeg/libijg12/jquant1.c	2025-02-18 18:03:13.530405562 +0100
+++ dcmtk-3.6.9/dcmjpeg/libijg12/jquant1.c	2025-02-18 18:05:52.953086535 +0100
@@ -251,8 +251,8 @@
    * (Forcing the upper and lower values to the limits ensures that
    * dithering can't produce a color outside the selected gamut.)
    */
-  (void) cinfo;
-  (void) ci;
+  //(void) cinfo;
+  //(void) ci;
   return (int) (((IJG_INT32) j * MAXJSAMPLE + maxj/2) / maxj);
 }
 
@@ -262,8 +262,8 @@
 /* Return largest input value that should map to j'th output value */
 /* Must have largest(j=0) >= 0, and largest(j=maxj) >= MAXJSAMPLE */
 {
-  (void) cinfo;
-  (void) ci;
+  //(void) cinfo;
+  //(void) ci;
   /* Breakpoints are halfway between values returned by output_value */
   return (int) (((IJG_INT32) (2*j + 1) * MAXJSAMPLE + maxj) / (2*maxj));
 }
@@ -744,7 +744,7 @@
 METHODDEF(void)
 start_pass_1_quant (j_decompress_ptr cinfo, boolean is_pre_scan)
 {
-  (void) is_pre_scan;
+  //(void) is_pre_scan;
   my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
   size_t arraysize;
   int i;
@@ -802,7 +802,7 @@
 METHODDEF(void)
 finish_pass_1_quant (j_decompress_ptr cinfo)
 {
-  (void) cinfo;
+  //(void) cinfo;
   /* no work in 1-pass case */
 }
 
diff -urEb dcmtk-3.6.9.orig/dcmjpeg/libijg12/jquant2.c dcmtk-3.6.9/dcmjpeg/libijg12/jquant2.c
--- dcmtk-3.6.9.orig/dcmjpeg/libijg12/jquant2.c	2025-02-18 18:03:13.530405562 +0100
+++ dcmtk-3.6.9/dcmjpeg/libijg12/jquant2.c	2025-02-18 18:05:52.954086521 +0100
@@ -224,7 +224,7 @@
 prescan_quantize (j_decompress_ptr cinfo, JSAMPARRAY input_buf,
           JSAMPARRAY output_buf, int num_rows)
 {
-  (void) output_buf;
+  //(void) output_buf;
   my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
   register JSAMPROW ptr;
   register histptr histp;
@@ -1156,7 +1156,7 @@
 METHODDEF(void)
 finish_pass2 (j_decompress_ptr cinfo)
 {
-  (void) cinfo;
+  //(void) cinfo;
   /* no work */
 }
 
diff -urEb dcmtk-3.6.9.orig/dcmjpeg/libijg16/jccoefct.c dcmtk-3.6.9/dcmjpeg/libijg16/jccoefct.c
--- dcmtk-3.6.9.orig/dcmjpeg/libijg16/jccoefct.c	2025-02-18 18:03:13.531405546 +0100
+++ dcmtk-3.6.9/dcmjpeg/libijg16/jccoefct.c	2025-02-18 18:05:52.954086521 +0100
@@ -343,7 +343,7 @@
 METHODDEF(boolean)
 compress_output (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
 {
-  (void)input_buf;
+  //(void)input_buf;
   j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec;
   c_coef_ptr coef = (c_coef_ptr) lossyc->coef_private;
   JDIMENSION MCU_col_num;   /* index of current MCU within row */
diff -urEb dcmtk-3.6.9.orig/dcmjpeg/libijg16/jcdiffct.c dcmtk-3.6.9/dcmjpeg/libijg16/jcdiffct.c
--- dcmtk-3.6.9.orig/dcmjpeg/libijg16/jcdiffct.c	2025-02-18 18:03:13.531405546 +0100
+++ dcmtk-3.6.9/dcmjpeg/libijg16/jcdiffct.c	2025-02-18 18:05:52.954086521 +0100
@@ -302,7 +302,7 @@
 METHODDEF(boolean)
 compress_output (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
 {
-  (void)input_buf;
+  //(void)input_buf;
   j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec;
   c_diff_ptr diff = (c_diff_ptr) losslsc->diff_private;
   /* JDIMENSION MCU_col_num; */ /* index of current MCU within row */
diff -urEb dcmtk-3.6.9.orig/dcmjpeg/libijg16/jcpred.c dcmtk-3.6.9/dcmjpeg/libijg16/jcpred.c
--- dcmtk-3.6.9.orig/dcmjpeg/libijg16/jcpred.c	2025-02-18 18:03:13.531405546 +0100
+++ dcmtk-3.6.9/dcmjpeg/libijg16/jcpred.c	2025-02-18 18:05:52.954086521 +0100
@@ -213,7 +213,7 @@
          const JSAMPROW input_buf, JSAMPROW prev_row,
          JDIFFROW diff_buf, JDIMENSION width)
 {
-  (void)prev_row;
+  //(void)prev_row;
   DIFFERENCE_1D(INITIAL_PREDICTORx);
 
   /*
diff -urEb dcmtk-3.6.9.orig/dcmjpeg/libijg16/jctrans.c dcmtk-3.6.9/dcmjpeg/libijg16/jctrans.c
--- dcmtk-3.6.9.orig/dcmjpeg/libijg16/jctrans.c	2025-02-18 18:03:13.531405546 +0100
+++ dcmtk-3.6.9/dcmjpeg/libijg16/jctrans.c	2025-02-18 18:05:52.954086521 +0100
@@ -267,7 +267,7 @@
 METHODDEF(boolean)
 compress_output (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
 {
-  (void)input_buf;
+  //(void)input_buf;
   j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec;
   c_coef_ptr coef = (c_coef_ptr) lossyc->coef_private;
   JDIMENSION MCU_col_num;   /* index of current MCU within row */
diff -urEb dcmtk-3.6.9.orig/dcmjpeg/libijg16/jdmerge.c dcmtk-3.6.9/dcmjpeg/libijg16/jdmerge.c
--- dcmtk-3.6.9.orig/dcmjpeg/libijg16/jdmerge.c	2025-02-18 18:03:13.531405546 +0100
+++ dcmtk-3.6.9/dcmjpeg/libijg16/jdmerge.c	2025-02-18 18:05:52.955086508 +0100
@@ -169,7 +169,7 @@
             JDIMENSION out_rows_avail)
 /* 2:1 vertical sampling case: may need a spare row. */
 {
-  (void) in_row_groups_avail;
+  //(void) in_row_groups_avail;
   my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
   JSAMPROW work_ptrs[2];
   JDIMENSION num_rows;      /* number of rows returned to caller */
@@ -219,8 +219,8 @@
             JDIMENSION out_rows_avail)
 /* 1:1 vertical sampling case: much easier, never need a spare row. */
 {
-  (void) in_row_groups_avail;
-  (void) out_rows_avail;
+  //(void) in_row_groups_avail;
+  //(void) out_rows_avail;
   my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
 
   /* Just do the upsampling. */
diff -urEb dcmtk-3.6.9.orig/dcmjpeg/libijg16/jdpostct.c dcmtk-3.6.9/dcmjpeg/libijg16/jdpostct.c
--- dcmtk-3.6.9.orig/dcmjpeg/libijg16/jdpostct.c	2025-02-18 18:03:13.531405546 +0100
+++ dcmtk-3.6.9/dcmjpeg/libijg16/jdpostct.c	2025-02-18 18:05:52.955086508 +0100
@@ -161,8 +161,8 @@
               JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
               JDIMENSION out_rows_avail)
 {
-  (void) output_buf;
-  (void) out_rows_avail;
+  //(void) output_buf;
+  //(void) out_rows_avail;
   my_post_ptr post = (my_post_ptr) cinfo->post;
   JDIMENSION old_next_row, num_rows;
 
@@ -207,9 +207,9 @@
             JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
             JDIMENSION out_rows_avail)
 {
-  (void) input_buf;
-  (void) in_row_group_ctr;
-  (void) in_row_groups_avail;
+  //(void) input_buf;
+  //(void) in_row_group_ctr;
+  //(void) in_row_groups_avail;
   my_post_ptr post = (my_post_ptr) cinfo->post;
   JDIMENSION num_rows, max_rows;
 
diff -urEb dcmtk-3.6.9.orig/dcmjpeg/libijg16/jdpred.c dcmtk-3.6.9/dcmjpeg/libijg16/jdpred.c
--- dcmtk-3.6.9.orig/dcmjpeg/libijg16/jdpred.c	2025-02-18 18:03:13.531405546 +0100
+++ dcmtk-3.6.9/dcmjpeg/libijg16/jdpred.c	2025-02-18 18:05:52.955086508 +0100
@@ -101,8 +101,8 @@
            const JDIFFROW diff_buf, const JDIFFROW prev_row,
            JDIFFROW undiff_buf, JDIMENSION width)
 {
-  (void)cinfo;
-  (void)comp_index;
+  //(void)cinfo;
+  //(void)comp_index;
   UNDIFFERENCE_1D(INITIAL_PREDICTOR2);
 }
 
@@ -111,8 +111,8 @@
            const JDIFFROW diff_buf, const JDIFFROW prev_row,
            JDIFFROW undiff_buf, JDIMENSION width)
 {
-   (void)cinfo;
-  (void)comp_index;
+   //(void)cinfo;
+  //(void)comp_index;
  UNDIFFERENCE_2D(PREDICTOR2);
   JPEG_UNUSED(Rc);
   JPEG_UNUSED(Rb);
@@ -123,8 +123,8 @@
            const JDIFFROW diff_buf, const JDIFFROW prev_row,
            JDIFFROW undiff_buf, JDIMENSION width)
 {
-  (void)cinfo;
-  (void)comp_index;
+  //(void)cinfo;
+  //(void)comp_index;
   UNDIFFERENCE_2D(PREDICTOR3);
   JPEG_UNUSED(Rc);
   JPEG_UNUSED(Rb);
@@ -135,8 +135,8 @@
            const JDIFFROW diff_buf, const JDIFFROW prev_row,
            JDIFFROW undiff_buf, JDIMENSION width)
 {
-  (void)cinfo;
-  (void)comp_index;
+  //(void)cinfo;
+  //(void)comp_index;
   UNDIFFERENCE_2D(PREDICTOR4A);
   JPEG_UNUSED(Rc);
   JPEG_UNUSED(Rb);
@@ -147,8 +147,8 @@
            const JDIFFROW diff_buf, const JDIFFROW prev_row,
            JDIFFROW undiff_buf, JDIMENSION width)
 {
-  (void)cinfo;
-  (void)comp_index;
+  //(void)cinfo;
+  //(void)comp_index;
   UNDIFFERENCE_2D(PREDICTOR4);
   JPEG_UNUSED(Rc);
   JPEG_UNUSED(Rb);
@@ -159,8 +159,8 @@
            const JDIFFROW diff_buf, const JDIFFROW prev_row,
            JDIFFROW undiff_buf, JDIMENSION width)
 {
-  (void)cinfo;
-  (void)comp_index;
+  //(void)cinfo;
+  //(void)comp_index;
   SHIFT_TEMPS
   UNDIFFERENCE_2D(PREDICTOR5);
   JPEG_UNUSED(Rc);
@@ -172,8 +172,8 @@
            const JDIFFROW diff_buf, const JDIFFROW prev_row,
            JDIFFROW undiff_buf, JDIMENSION width)
 {
-  (void)cinfo;
-  (void)comp_index;
+  //(void)cinfo;
+  //(void)comp_index;
   SHIFT_TEMPS
   UNDIFFERENCE_2D(PREDICTOR5A);
   JPEG_UNUSED(Rc);
@@ -185,8 +185,8 @@
            const JDIFFROW diff_buf, const JDIFFROW prev_row,
            JDIFFROW undiff_buf, JDIMENSION width)
 {
-  (void)cinfo;
-  (void)comp_index;
+  //(void)cinfo;
+  //(void)comp_index;
   SHIFT_TEMPS
   UNDIFFERENCE_2D(PREDICTOR6);
   JPEG_UNUSED(Rc);
@@ -198,8 +198,8 @@
            const JDIFFROW diff_buf, const JDIFFROW prev_row,
            JDIFFROW undiff_buf, JDIMENSION width)
 {
-  (void)cinfo;
-  (void)comp_index;
+  //(void)cinfo;
+  //(void)comp_index;
   SHIFT_TEMPS
   UNDIFFERENCE_2D(PREDICTOR6A);
   JPEG_UNUSED(Rc);
@@ -211,8 +211,8 @@
            const JDIFFROW diff_buf, const JDIFFROW prev_row,
            JDIFFROW undiff_buf, JDIMENSION width)
 {
-  (void)cinfo;
-  (void)comp_index;
+  //(void)cinfo;
+  //(void)comp_index;
   SHIFT_TEMPS
   UNDIFFERENCE_2D(PREDICTOR7);
   JPEG_UNUSED(Rc);
@@ -224,8 +224,8 @@
            const JDIFFROW diff_buf, const JDIFFROW prev_row,
            JDIFFROW undiff_buf, JDIMENSION width)
 {
-  (void)cinfo;
-  (void)comp_index;
+  //(void)cinfo;
+  //(void)comp_index;
   SHIFT_TEMPS
   UNDIFFERENCE_2D(PREDICTOR7A);
   JPEG_UNUSED(Rc);
@@ -245,7 +245,7 @@
                 const JDIFFROW diff_buf, JDIFFROW prev_row,
                 JDIFFROW undiff_buf, JDIMENSION width)
 {
-  (void)prev_row;
+  //(void)prev_row;
   j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec;
 
   UNDIFFERENCE_1D(INITIAL_PREDICTORx);
diff -urEb dcmtk-3.6.9.orig/dcmjpeg/libijg16/jdsample.c dcmtk-3.6.9/dcmjpeg/libijg16/jdsample.c
--- dcmtk-3.6.9.orig/dcmjpeg/libijg16/jdsample.c	2025-02-18 18:03:13.531405546 +0100
+++ dcmtk-3.6.9/dcmjpeg/libijg16/jdsample.c	2025-02-18 18:05:52.955086508 +0100
@@ -92,7 +92,7 @@
           JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
           JDIMENSION out_rows_avail)
 {
-  (void)in_row_groups_avail;
+  //(void)in_row_groups_avail;
   my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
   int ci;
   jpeg_component_info * compptr;
@@ -158,8 +158,8 @@
 fullsize_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,
            JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)
 {
-  (void)cinfo;
-  (void)compptr;
+  //(void)cinfo;
+  //(void)compptr;
   *output_data_ptr = input_data;
 }
 
@@ -173,9 +173,9 @@
 noop_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,
            JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)
 {
-  (void)cinfo;
-  (void)compptr;
-  (void)input_data;
+  //(void)cinfo;
+  //(void)compptr;
+  //(void)input_data;
   *output_data_ptr = NULL;  /* safety check */
 }
 
@@ -239,7 +239,7 @@
 h2v1_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,
            JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)
 {
-  (void)compptr;
+  //(void)compptr;
   JSAMPARRAY output_data = *output_data_ptr;
   register JSAMPROW inptr, outptr;
   register JSAMPLE invalue;
@@ -268,7 +268,7 @@
 h2v2_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,
            JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)
 {
-  (void)compptr;
+  //(void)compptr;
   JSAMPARRAY output_data = *output_data_ptr;
   register JSAMPROW inptr, outptr;
   register JSAMPLE invalue;
diff -urEb dcmtk-3.6.9.orig/dcmjpeg/libijg16/jdscale.c dcmtk-3.6.9/dcmjpeg/libijg16/jdscale.c
--- dcmtk-3.6.9.orig/dcmjpeg/libijg16/jdscale.c	2025-02-18 18:03:13.531405546 +0100
+++ dcmtk-3.6.9/dcmjpeg/libijg16/jdscale.c	2025-02-18 18:05:52.955086508 +0100
@@ -67,7 +67,7 @@
 	const JDIFFROW diff_buf, JSAMPROW output_buf,
 	JDIMENSION width)
 {
-  (void)cinfo;
+  //(void)cinfo;
   unsigned int xindex;
 
   for (xindex = 0; xindex < width; xindex++)
diff -urEb dcmtk-3.6.9.orig/dcmjpeg/libijg16/jerror.c dcmtk-3.6.9/dcmjpeg/libijg16/jerror.c
--- dcmtk-3.6.9.orig/dcmjpeg/libijg16/jerror.c	2025-02-18 18:03:13.531405546 +0100
+++ dcmtk-3.6.9/dcmjpeg/libijg16/jerror.c	2025-02-18 18:05:52.955086508 +0100
@@ -34,6 +34,10 @@
 #define EXIT_FAILURE  1
 #endif
 
+#if defined(_MSC_VER) && _MSC_VER < 1900
+#define snprintf _snprintf
+#endif
+
 
 /*
  * Create the message string table.
diff -urEb dcmtk-3.6.9.orig/dcmjpeg/libijg16/jquant1.c dcmtk-3.6.9/dcmjpeg/libijg16/jquant1.c
--- dcmtk-3.6.9.orig/dcmjpeg/libijg16/jquant1.c	2025-02-18 18:03:13.531405546 +0100
+++ dcmtk-3.6.9/dcmjpeg/libijg16/jquant1.c	2025-02-18 18:05:52.956086494 +0100
@@ -251,8 +251,8 @@
    * (Forcing the upper and lower values to the limits ensures that
    * dithering can't produce a color outside the selected gamut.)
    */
-  (void) cinfo;
-  (void) ci;
+  //(void) cinfo;
+  //(void) ci;
   return (int) (((IJG_INT32) j * MAXJSAMPLE + maxj/2) / maxj);
 }
 
@@ -262,8 +262,8 @@
 /* Return largest input value that should map to j'th output value */
 /* Must have largest(j=0) >= 0, and largest(j=maxj) >= MAXJSAMPLE */
 {
-  (void) cinfo;
-  (void) ci;
+  //(void) cinfo;
+  //(void) ci;
   /* Breakpoints are halfway between values returned by output_value */
   return (int) (((IJG_INT32) (2*j + 1) * MAXJSAMPLE + maxj) / (2*maxj));
 }
@@ -744,7 +744,7 @@
 METHODDEF(void)
 start_pass_1_quant (j_decompress_ptr cinfo, boolean is_pre_scan)
 {
-  (void) is_pre_scan;
+  //(void) is_pre_scan;
   my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
   size_t arraysize;
   int i;
@@ -802,7 +802,7 @@
 METHODDEF(void)
 finish_pass_1_quant (j_decompress_ptr cinfo)
 {
-  (void) cinfo;
+  //(void) cinfo;
   /* no work in 1-pass case */
 }
 
diff -urEb dcmtk-3.6.9.orig/dcmjpeg/libijg16/jquant2.c dcmtk-3.6.9/dcmjpeg/libijg16/jquant2.c
--- dcmtk-3.6.9.orig/dcmjpeg/libijg16/jquant2.c	2025-02-18 18:03:13.531405546 +0100
+++ dcmtk-3.6.9/dcmjpeg/libijg16/jquant2.c	2025-02-18 18:05:52.956086494 +0100
@@ -224,7 +224,7 @@
 prescan_quantize (j_decompress_ptr cinfo, JSAMPARRAY input_buf,
           JSAMPARRAY output_buf, int num_rows)
 {
-  (void) output_buf;
+  //(void) output_buf;
   my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
   register JSAMPROW ptr;
   register histptr histp;
@@ -1156,7 +1156,7 @@
 METHODDEF(void)
 finish_pass2 (j_decompress_ptr cinfo)
 {
-  (void) cinfo;
+  //(void) cinfo;
   /* no work */
 }
 
diff -urEb dcmtk-3.6.9.orig/dcmjpeg/libijg8/jccoefct.c dcmtk-3.6.9/dcmjpeg/libijg8/jccoefct.c
--- dcmtk-3.6.9.orig/dcmjpeg/libijg8/jccoefct.c	2025-02-18 18:03:13.533405515 +0100
+++ dcmtk-3.6.9/dcmjpeg/libijg8/jccoefct.c	2025-02-18 18:05:52.956086494 +0100
@@ -343,7 +343,7 @@
 METHODDEF(boolean)
 compress_output (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
 {
-  (void)input_buf;
+  //(void)input_buf;
   j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec;
   c_coef_ptr coef = (c_coef_ptr) lossyc->coef_private;
   JDIMENSION MCU_col_num;   /* index of current MCU within row */
diff -urEb dcmtk-3.6.9.orig/dcmjpeg/libijg8/jcdiffct.c dcmtk-3.6.9/dcmjpeg/libijg8/jcdiffct.c
--- dcmtk-3.6.9.orig/dcmjpeg/libijg8/jcdiffct.c	2025-02-18 18:03:13.533405515 +0100
+++ dcmtk-3.6.9/dcmjpeg/libijg8/jcdiffct.c	2025-02-18 18:05:52.956086494 +0100
@@ -302,7 +302,7 @@
 METHODDEF(boolean)
 compress_output (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
 {
-  (void)input_buf;
+  //(void)input_buf;
   j_lossless_c_ptr losslsc = (j_lossless_c_ptr) cinfo->codec;
   c_diff_ptr diff = (c_diff_ptr) losslsc->diff_private;
   /* JDIMENSION MCU_col_num; */ /* index of current MCU within row */
diff -urEb dcmtk-3.6.9.orig/dcmjpeg/libijg8/jcpred.c dcmtk-3.6.9/dcmjpeg/libijg8/jcpred.c
--- dcmtk-3.6.9.orig/dcmjpeg/libijg8/jcpred.c	2025-02-18 18:03:13.533405515 +0100
+++ dcmtk-3.6.9/dcmjpeg/libijg8/jcpred.c	2025-02-18 18:05:52.957086481 +0100
@@ -213,7 +213,7 @@
          const JSAMPROW input_buf, JSAMPROW prev_row,
          JDIFFROW diff_buf, JDIMENSION width)
 {
-  (void)prev_row;
+  //(void)prev_row;
   DIFFERENCE_1D(INITIAL_PREDICTORx);
 
   /*
diff -urEb dcmtk-3.6.9.orig/dcmjpeg/libijg8/jctrans.c dcmtk-3.6.9/dcmjpeg/libijg8/jctrans.c
--- dcmtk-3.6.9.orig/dcmjpeg/libijg8/jctrans.c	2025-02-18 18:03:13.533405515 +0100
+++ dcmtk-3.6.9/dcmjpeg/libijg8/jctrans.c	2025-02-18 18:05:52.957086481 +0100
@@ -267,7 +267,7 @@
 METHODDEF(boolean)
 compress_output (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
 {
-  (void)input_buf;
+  //(void)input_buf;
   j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec;
   c_coef_ptr coef = (c_coef_ptr) lossyc->coef_private;
   JDIMENSION MCU_col_num;   /* index of current MCU within row */
diff -urEb dcmtk-3.6.9.orig/dcmjpeg/libijg8/jdmerge.c dcmtk-3.6.9/dcmjpeg/libijg8/jdmerge.c
--- dcmtk-3.6.9.orig/dcmjpeg/libijg8/jdmerge.c	2025-02-18 18:03:13.533405515 +0100
+++ dcmtk-3.6.9/dcmjpeg/libijg8/jdmerge.c	2025-02-18 18:05:52.957086481 +0100
@@ -148,7 +148,7 @@
             JDIMENSION out_rows_avail)
 /* 2:1 vertical sampling case: may need a spare row. */
 {
-  (void) in_row_groups_avail;
+  //(void) in_row_groups_avail;
   my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
   JSAMPROW work_ptrs[2];
   JDIMENSION num_rows;      /* number of rows returned to caller */
@@ -198,8 +198,8 @@
             JDIMENSION out_rows_avail)
 /* 1:1 vertical sampling case: much easier, never need a spare row. */
 {
-  (void) in_row_groups_avail;
-  (void) out_rows_avail;
+  //(void) in_row_groups_avail;
+  //(void) out_rows_avail;
   my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
 
   /* Just do the upsampling. */
diff -urEb dcmtk-3.6.9.orig/dcmjpeg/libijg8/jdpostct.c dcmtk-3.6.9/dcmjpeg/libijg8/jdpostct.c
--- dcmtk-3.6.9.orig/dcmjpeg/libijg8/jdpostct.c	2025-02-18 18:03:13.533405515 +0100
+++ dcmtk-3.6.9/dcmjpeg/libijg8/jdpostct.c	2025-02-18 18:05:52.957086481 +0100
@@ -161,8 +161,8 @@
               JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
               JDIMENSION out_rows_avail)
 {
-  (void) output_buf;
-  (void) out_rows_avail;
+  //(void) output_buf;
+  //(void) out_rows_avail;
   my_post_ptr post = (my_post_ptr) cinfo->post;
   JDIMENSION old_next_row, num_rows;
 
@@ -207,9 +207,9 @@
             JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
             JDIMENSION out_rows_avail)
 {
-  (void) input_buf;
-  (void) in_row_group_ctr;
-  (void) in_row_groups_avail;
+  //(void) input_buf;
+  //(void) in_row_group_ctr;
+  //(void) in_row_groups_avail;
   my_post_ptr post = (my_post_ptr) cinfo->post;
   JDIMENSION num_rows, max_rows;
 
diff -urEb dcmtk-3.6.9.orig/dcmjpeg/libijg8/jdpred.c dcmtk-3.6.9/dcmjpeg/libijg8/jdpred.c
--- dcmtk-3.6.9.orig/dcmjpeg/libijg8/jdpred.c	2025-02-18 18:03:13.533405515 +0100
+++ dcmtk-3.6.9/dcmjpeg/libijg8/jdpred.c	2025-02-18 18:05:52.957086481 +0100
@@ -101,8 +101,8 @@
            const JDIFFROW diff_buf, const JDIFFROW prev_row,
            JDIFFROW undiff_buf, JDIMENSION width)
 {
-  (void)cinfo;
-  (void)comp_index;
+  //(void)cinfo;
+  //(void)comp_index;
   UNDIFFERENCE_1D(INITIAL_PREDICTOR2);
 }
 
@@ -111,8 +111,8 @@
            const JDIFFROW diff_buf, const JDIFFROW prev_row,
            JDIFFROW undiff_buf, JDIMENSION width)
 {
-  (void)cinfo;
-  (void)comp_index;
+  //(void)cinfo;
+  //(void)comp_index;
   UNDIFFERENCE_2D(PREDICTOR2);
   JPEG_UNUSED(Rc);
   JPEG_UNUSED(Rb);
@@ -123,8 +123,8 @@
            const JDIFFROW diff_buf, const JDIFFROW prev_row,
            JDIFFROW undiff_buf, JDIMENSION width)
 {
-  (void)cinfo;
-  (void)comp_index;
+  //(void)cinfo;
+  //(void)comp_index;
   UNDIFFERENCE_2D(PREDICTOR3);
   JPEG_UNUSED(Rc);
   JPEG_UNUSED(Rb);
@@ -135,8 +135,8 @@
            const JDIFFROW diff_buf, const JDIFFROW prev_row,
            JDIFFROW undiff_buf, JDIMENSION width)
 {
-  (void)cinfo;
-  (void)comp_index;
+  //(void)cinfo;
+  //(void)comp_index;
   UNDIFFERENCE_2D(PREDICTOR4);
   JPEG_UNUSED(Rc);
   JPEG_UNUSED(Rb);
@@ -147,8 +147,8 @@
            const JDIFFROW diff_buf, const JDIFFROW prev_row,
            JDIFFROW undiff_buf, JDIMENSION width)
 {
-  (void)cinfo;
-  (void)comp_index;
+  //(void)cinfo;
+  //(void)comp_index;
   SHIFT_TEMPS
   UNDIFFERENCE_2D(PREDICTOR5);
   JPEG_UNUSED(Rc);
@@ -160,8 +160,8 @@
            const JDIFFROW diff_buf, const JDIFFROW prev_row,
            JDIFFROW undiff_buf, JDIMENSION width)
 {
-  (void)cinfo;
-  (void)comp_index;
+  //(void)cinfo;
+  //(void)comp_index;
   SHIFT_TEMPS
   UNDIFFERENCE_2D(PREDICTOR6);
   JPEG_UNUSED(Rc);
@@ -173,8 +173,8 @@
            const JDIFFROW diff_buf, const JDIFFROW prev_row,
            JDIFFROW undiff_buf, JDIMENSION width)
 {
-  (void)cinfo;
-  (void)comp_index;
+  //(void)cinfo;
+  //(void)comp_index;
   SHIFT_TEMPS
   UNDIFFERENCE_2D(PREDICTOR7);
   JPEG_UNUSED(Rc);
@@ -194,7 +194,7 @@
                 const JDIFFROW diff_buf, JDIFFROW prev_row,
                 JDIFFROW undiff_buf, JDIMENSION width)
 {
-  (void)prev_row;
+  //(void)prev_row;
   j_lossless_d_ptr losslsd = (j_lossless_d_ptr) cinfo->codec;
 
   UNDIFFERENCE_1D(INITIAL_PREDICTORx);
diff -urEb dcmtk-3.6.9.orig/dcmjpeg/libijg8/jdsample.c dcmtk-3.6.9/dcmjpeg/libijg8/jdsample.c
--- dcmtk-3.6.9.orig/dcmjpeg/libijg8/jdsample.c	2025-02-18 18:03:13.533405515 +0100
+++ dcmtk-3.6.9/dcmjpeg/libijg8/jdsample.c	2025-02-18 18:05:52.957086481 +0100
@@ -92,7 +92,7 @@
           JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
           JDIMENSION out_rows_avail)
 {
-  (void)in_row_groups_avail;
+  //(void)in_row_groups_avail;
   my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
   int ci;
   jpeg_component_info * compptr;
@@ -158,8 +158,8 @@
 fullsize_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,
            JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)
 {
-  (void)cinfo;
-  (void)compptr;
+  //(void)cinfo;
+  //(void)compptr;
   *output_data_ptr = input_data;
 }
 
@@ -173,9 +173,9 @@
 noop_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,
            JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)
 {
-  (void)cinfo;
-  (void)compptr;
-  (void)input_data;
+  //(void)cinfo;
+  //(void)compptr;
+  //(void)input_data;
   *output_data_ptr = NULL;  /* safety check */
 }
 
@@ -239,7 +239,7 @@
 h2v1_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,
            JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)
 {
-  (void)compptr;
+  //(void)compptr;
   JSAMPARRAY output_data = *output_data_ptr;
   register JSAMPROW inptr, outptr;
   register JSAMPLE invalue;
@@ -268,7 +268,7 @@
 h2v2_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,
            JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)
 {
-  (void)compptr;
+  //(void)compptr;
   JSAMPARRAY output_data = *output_data_ptr;
   register JSAMPROW inptr, outptr;
   register JSAMPLE invalue;
diff -urEb dcmtk-3.6.9.orig/dcmjpeg/libijg8/jdscale.c dcmtk-3.6.9/dcmjpeg/libijg8/jdscale.c
--- dcmtk-3.6.9.orig/dcmjpeg/libijg8/jdscale.c	2025-02-18 18:03:13.532405530 +0100
+++ dcmtk-3.6.9/dcmjpeg/libijg8/jdscale.c	2025-02-18 18:05:52.958086467 +0100
@@ -67,7 +67,7 @@
 	const JDIFFROW diff_buf, JSAMPROW output_buf,
 	JDIMENSION width)
 {
-  (void)cinfo;
+  //(void)cinfo;
   unsigned int xindex;
 
   for (xindex = 0; xindex < width; xindex++)
diff -urEb dcmtk-3.6.9.orig/dcmjpeg/libijg8/jerror.c dcmtk-3.6.9/dcmjpeg/libijg8/jerror.c
--- dcmtk-3.6.9.orig/dcmjpeg/libijg8/jerror.c	2025-02-18 18:03:13.533405515 +0100
+++ dcmtk-3.6.9/dcmjpeg/libijg8/jerror.c	2025-02-18 18:05:52.958086467 +0100
@@ -34,6 +34,10 @@
 #define EXIT_FAILURE  1
 #endif
 
+#if defined(_MSC_VER) && _MSC_VER < 1900
+#define snprintf _snprintf
+#endif
+
 
 /*
  * Create the message string table.
diff -urEb dcmtk-3.6.9.orig/dcmjpeg/libijg8/jquant1.c dcmtk-3.6.9/dcmjpeg/libijg8/jquant1.c
--- dcmtk-3.6.9.orig/dcmjpeg/libijg8/jquant1.c	2025-02-18 18:03:13.532405530 +0100
+++ dcmtk-3.6.9/dcmjpeg/libijg8/jquant1.c	2025-02-18 18:05:52.958086467 +0100
@@ -251,8 +251,8 @@
    * (Forcing the upper and lower values to the limits ensures that
    * dithering can't produce a color outside the selected gamut.)
    */
-  (void) cinfo;
-  (void) ci;
+  //(void) cinfo;
+  //(void) ci;
   return (int) (((IJG_INT32) j * MAXJSAMPLE + maxj/2) / maxj);
 }
 
@@ -262,8 +262,8 @@
 /* Return largest input value that should map to j'th output value */
 /* Must have largest(j=0) >= 0, and largest(j=maxj) >= MAXJSAMPLE */
 {
-  (void) cinfo;
-  (void) ci;
+  //(void) cinfo;
+  //(void) ci;
   /* Breakpoints are halfway between values returned by output_value */
   return (int) (((IJG_INT32) (2*j + 1) * MAXJSAMPLE + maxj) / (2*maxj));
 }
@@ -744,7 +744,7 @@
 METHODDEF(void)
 start_pass_1_quant (j_decompress_ptr cinfo, boolean is_pre_scan)
 {
-  (void) is_pre_scan;
+  //(void) is_pre_scan;
   my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
   size_t arraysize;
   int i;
@@ -802,7 +802,7 @@
 METHODDEF(void)
 finish_pass_1_quant (j_decompress_ptr cinfo)
 {
-  (void) cinfo;
+  //(void) cinfo;
   /* no work in 1-pass case */
 }
 
diff -urEb dcmtk-3.6.9.orig/dcmjpeg/libijg8/jquant2.c dcmtk-3.6.9/dcmjpeg/libijg8/jquant2.c
--- dcmtk-3.6.9.orig/dcmjpeg/libijg8/jquant2.c	2025-02-18 18:03:13.532405530 +0100
+++ dcmtk-3.6.9/dcmjpeg/libijg8/jquant2.c	2025-02-18 18:05:52.958086467 +0100
@@ -224,7 +224,7 @@
 prescan_quantize (j_decompress_ptr cinfo, JSAMPARRAY input_buf,
           JSAMPARRAY output_buf, int num_rows)
 {
-  (void) output_buf;
+  //(void) output_buf;
   my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
   register JSAMPROW ptr;
   register histptr histp;
@@ -1156,7 +1156,7 @@
 METHODDEF(void)
 finish_pass2 (j_decompress_ptr cinfo)
 {
-  (void) cinfo;
+  //(void) cinfo;
   /* no work */
 }
 
diff -urEb dcmtk-3.6.9.orig/oficonv/libsrc/citrus_bcs.h dcmtk-3.6.9/oficonv/libsrc/citrus_bcs.h
--- dcmtk-3.6.9.orig/oficonv/libsrc/citrus_bcs.h	2025-02-18 18:03:13.519405733 +0100
+++ dcmtk-3.6.9/oficonv/libsrc/citrus_bcs.h	2025-02-18 18:05:52.958086467 +0100
@@ -39,7 +39,21 @@
 #include <errno.h>
 #include <stdint.h>
 #include <limits.h>
+
+#undef EOPNOTSUPP
+#define EOPNOTSUPP 130   // https://learn.microsoft.com/fr-fr/cpp/c-runtime-library/errno-constants
+
+#if (_MSC_VER >= 1900)
 #include <stdbool.h>
+#else
+#define bool int
+#define false 0
+#define true 1
+#endif
+
+#if defined(_MSC_VER) && _MSC_VER < 1900
+#define snprintf _snprintf
+#endif
 
 #define CITRUS_DECONST(type, var)    ((type)(uintptr_t)(const void *)(var))
 
diff -urEb dcmtk-3.6.9.orig/oficonv/libsrc/citrus_big5.c dcmtk-3.6.9/oficonv/libsrc/citrus_big5.c
--- dcmtk-3.6.9.orig/oficonv/libsrc/citrus_big5.c	2025-02-18 18:03:13.511405858 +0100
+++ dcmtk-3.6.9/oficonv/libsrc/citrus_big5.c	2025-02-18 18:05:52.959086454 +0100
@@ -218,13 +218,6 @@
     return (0);
 }
 
-static const _citrus_prop_hint_t root_hints[] = {
-    _CITRUS_PROP_HINT_NUM("row", &_citrus_BIG5_fill_rowcol),
-    _CITRUS_PROP_HINT_NUM("col", &_citrus_BIG5_fill_rowcol),
-    _CITRUS_PROP_HINT_NUM("excludes", &_citrus_BIG5_fill_excludes),
-    _CITRUS_PROP_HINT_END
-};
-
 static void
 /*ARGSUSED*/
 _citrus_BIG5_encoding_module_uninit(_BIG5EncodingInfo *ei)
@@ -245,6 +238,18 @@
     const char *s;
     int err;
 
+    _citrus_prop_hint_t root_hints[4];
+    root_hints[0].name = "row";
+    root_hints[0].type = _CITRUS_PROP_NUM;
+    root_hints[0].cb.num.func = _citrus_BIG5_fill_rowcol;
+    root_hints[1].name = "col";
+    root_hints[1].type = _CITRUS_PROP_NUM;
+    root_hints[1].cb.num.func = _citrus_BIG5_fill_rowcol;
+    root_hints[2].name = "excludes";
+    root_hints[2].type = _CITRUS_PROP_NUM;
+    root_hints[2].cb.num.func = _citrus_BIG5_fill_excludes;
+    root_hints[3].name = NULL;  // _CITRUS_PROP_HINT_END
+
     memset((void *)ei, 0, sizeof(*ei));
     TAILQ_INIT(&ei->excludes);
 
diff -urEb dcmtk-3.6.9.orig/oficonv/libsrc/citrus_db_hash.h dcmtk-3.6.9/oficonv/libsrc/citrus_db_hash.h
--- dcmtk-3.6.9.orig/oficonv/libsrc/citrus_db_hash.h	2025-02-18 18:03:13.510405874 +0100
+++ dcmtk-3.6.9/oficonv/libsrc/citrus_db_hash.h	2025-02-18 18:05:52.959086454 +0100
@@ -29,7 +29,8 @@
 
 #include "dcmtk/config/osconfig.h"
 #include "dcmtk/oficonv/oidefine.h"
-#include <inttypes.h>
+
+#include <stdint.h>
 
 struct _citrus_region;
 
diff -urEb dcmtk-3.6.9.orig/oficonv/libsrc/citrus_esdb.c dcmtk-3.6.9/oficonv/libsrc/citrus_esdb.c
--- dcmtk-3.6.9.orig/oficonv/libsrc/citrus_esdb.c	2025-02-18 18:03:13.511405858 +0100
+++ dcmtk-3.6.9/oficonv/libsrc/citrus_esdb.c	2025-02-18 18:05:52.959086454 +0100
@@ -34,7 +34,15 @@
 
 #include <errno.h>
 #include <limits.h>
+
+#if (_MSC_VER >= 1900)
 #include <stdbool.h>
+#else
+#define bool int
+#define false 0
+#define true 1
+#endif
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
diff -urEb dcmtk-3.6.9.orig/oficonv/libsrc/citrus_esdb.h dcmtk-3.6.9/oficonv/libsrc/citrus_esdb.h
--- dcmtk-3.6.9.orig/oficonv/libsrc/citrus_esdb.h	2025-02-18 18:03:13.512405843 +0100
+++ dcmtk-3.6.9/oficonv/libsrc/citrus_esdb.h	2025-02-18 18:05:52.959086454 +0100
@@ -29,7 +29,14 @@
 
 #include "dcmtk/config/osconfig.h"
 #include "citrus_types.h"
+
+#if (_MSC_VER >= 1900)
 #include <stdbool.h>
+#else
+#define bool int
+#define false 0
+#define true 1
+#endif
 
 struct _citrus_esdb_charset {
     _citrus_csid_t           ec_csid;
diff -urEb dcmtk-3.6.9.orig/oficonv/libsrc/citrus_gbk2k.c dcmtk-3.6.9/oficonv/libsrc/citrus_gbk2k.c
--- dcmtk-3.6.9.orig/oficonv/libsrc/citrus_gbk2k.c	2025-02-18 18:03:13.519405733 +0100
+++ dcmtk-3.6.9/oficonv/libsrc/citrus_gbk2k.c	2025-02-18 18:05:52.959086454 +0100
@@ -34,7 +34,15 @@
 
 #include <errno.h>
 #include <limits.h>
+
+#if (_MSC_VER >= 1900)
 #include <stdbool.h>
+#else
+#define bool int
+#define false 0
+#define true 1
+#endif
+
 #include <stddef.h>
 #include <stdio.h>
 #include <stdlib.h>
diff -urEb dcmtk-3.6.9.orig/oficonv/libsrc/citrus_hz.c dcmtk-3.6.9/oficonv/libsrc/citrus_hz.c
--- dcmtk-3.6.9.orig/oficonv/libsrc/citrus_hz.c	2025-02-18 18:03:13.518405749 +0100
+++ dcmtk-3.6.9/oficonv/libsrc/citrus_hz.c	2025-02-18 18:05:52.959086454 +0100
@@ -571,13 +571,6 @@
     return (0);
 }
 
-static const _citrus_prop_hint_t escape_hints[] = {
-_CITRUS_PROP_HINT_STR("CH", &_citrus_HZ_parse_char),
-_CITRUS_PROP_HINT_STR("GL", &_citrus_HZ_parse_graphic),
-_CITRUS_PROP_HINT_STR("GR", &_citrus_HZ_parse_graphic),
-_CITRUS_PROP_HINT_END
-};
-
 static int
 _citrus_HZ_parse_escape(void *context, const char *name, const char *s)
 {
@@ -585,6 +578,18 @@
     escape_t *escape;
     void *p[2];
 
+    _citrus_prop_hint_t escape_hints[4];
+    escape_hints[0].name = "CH";
+    escape_hints[0].type = _CITRUS_PROP_STR;
+    escape_hints[0].cb.str.func = _citrus_HZ_parse_char;
+    escape_hints[1].name = "GL";
+    escape_hints[1].type = _CITRUS_PROP_STR;
+    escape_hints[1].cb.str.func = _citrus_HZ_parse_graphic;
+    escape_hints[2].name = "GR";
+    escape_hints[2].type = _CITRUS_PROP_STR;
+    escape_hints[2].cb.str.func = _citrus_HZ_parse_graphic;
+    escape_hints[3].name = NULL;  // _CITRUS_PROP_HINT_END
+
     ei = (_HZEncodingInfo *)context;
     escape = calloc(1, sizeof(*escape));
     if (escape == NULL)
@@ -605,18 +610,21 @@
         escape_hints, (void *)&p[0], s, strlen(s)));
 }
 
-static const _citrus_prop_hint_t root_hints[] = {
-_CITRUS_PROP_HINT_STR("0", &_citrus_HZ_parse_escape),
-_CITRUS_PROP_HINT_STR("1", &_citrus_HZ_parse_escape),
-_CITRUS_PROP_HINT_END
-};
-
 static int
 _citrus_HZ_encoding_module_init(_HZEncodingInfo * ei,
     const void * var, size_t lenvar)
 {
     int errnum;
 
+    _citrus_prop_hint_t root_hints[3];
+    root_hints[0].name = "0";
+    root_hints[0].type = _CITRUS_PROP_STR;
+    root_hints[0].cb.str.func = _citrus_HZ_parse_escape;
+    root_hints[1].name = "1";
+    root_hints[1].type = _CITRUS_PROP_STR;
+    root_hints[1].cb.str.func = _citrus_HZ_parse_escape;
+    root_hints[2].name = NULL;  // _CITRUS_PROP_HINT_END
+
     memset(ei, 0, sizeof(*ei));
     TAILQ_INIT(E0SET(ei));
     TAILQ_INIT(E1SET(ei));
diff -urEb dcmtk-3.6.9.orig/oficonv/libsrc/citrus_iconv_local.h dcmtk-3.6.9/oficonv/libsrc/citrus_iconv_local.h
--- dcmtk-3.6.9.orig/oficonv/libsrc/citrus_iconv_local.h	2025-02-18 18:03:13.520405718 +0100
+++ dcmtk-3.6.9/oficonv/libsrc/citrus_iconv_local.h	2025-02-18 18:05:52.960086440 +0100
@@ -29,7 +29,15 @@
 
 #include "dcmtk/config/osconfig.h"
 #include "dcmtk/oficonv/iconv.h"
+
+#if (_MSC_VER >= 1900)
 #include <stdbool.h>
+#else
+#define bool int
+#define false 0
+#define true 1
+#endif
+
 #include <stdint.h>
 
 #ifdef HAVE_SYS_QUEUE_H
diff -urEb dcmtk-3.6.9.orig/oficonv/libsrc/citrus_iconv_none.c dcmtk-3.6.9/oficonv/libsrc/citrus_iconv_none.c
--- dcmtk-3.6.9.orig/oficonv/libsrc/citrus_iconv_none.c	2025-02-18 18:03:13.516405780 +0100
+++ dcmtk-3.6.9/oficonv/libsrc/citrus_iconv_none.c	2025-02-18 18:05:52.960086440 +0100
@@ -35,7 +35,15 @@
 
 
 #include <errno.h>
+
+#if (_MSC_VER >= 1900)
 #include <stdbool.h>
+#else
+#define bool int
+#define false 0
+#define true 1
+#endif
+
 #include <stdlib.h>
 #include <string.h>
 
diff -urEb dcmtk-3.6.9.orig/oficonv/libsrc/citrus_iconv_std.c dcmtk-3.6.9/oficonv/libsrc/citrus_iconv_std.c
--- dcmtk-3.6.9.orig/oficonv/libsrc/citrus_iconv_std.c	2025-02-18 18:03:13.516405780 +0100
+++ dcmtk-3.6.9/oficonv/libsrc/citrus_iconv_std.c	2025-02-18 18:05:52.960086440 +0100
@@ -36,7 +36,15 @@
 
 #include <errno.h>
 #include <limits.h>
+
+#if (_MSC_VER >= 1900)
 #include <stdbool.h>
+#else
+#define bool int
+#define false 0
+#define true 1
+#endif
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
diff -urEb dcmtk-3.6.9.orig/oficonv/libsrc/citrus_iso2022.c dcmtk-3.6.9/oficonv/libsrc/citrus_iso2022.c
--- dcmtk-3.6.9.orig/oficonv/libsrc/citrus_iso2022.c	2025-02-18 18:03:13.516405780 +0100
+++ dcmtk-3.6.9/oficonv/libsrc/citrus_iso2022.c	2025-02-18 18:05:52.960086440 +0100
@@ -35,7 +35,15 @@
 
 #include <errno.h>
 #include <limits.h>
+
+#if (_MSC_VER >= 1900)
 #include <stdbool.h>
+#else
+#define bool int
+#define false 0
+#define true 1
+#endif
+
 #include <stddef.h>
 #include <stdio.h>
 #include <stdlib.h>
diff -urEb dcmtk-3.6.9.orig/oficonv/libsrc/citrus_johab.c dcmtk-3.6.9/oficonv/libsrc/citrus_johab.c
--- dcmtk-3.6.9.orig/oficonv/libsrc/citrus_johab.c	2025-02-18 18:03:13.518405749 +0100
+++ dcmtk-3.6.9/oficonv/libsrc/citrus_johab.c	2025-02-18 18:05:52.961086427 +0100
@@ -34,7 +34,15 @@
 
 #include <errno.h>
 #include <limits.h>
+
+#if (_MSC_VER >= 1900)
 #include <stdbool.h>
+#else
+#define bool int
+#define false 0
+#define true 1
+#endif
+
 #include <stddef.h>
 #include <stdint.h>
 #include <stdio.h>
diff -urEb dcmtk-3.6.9.orig/oficonv/libsrc/citrus_module.c dcmtk-3.6.9/oficonv/libsrc/citrus_module.c
--- dcmtk-3.6.9.orig/oficonv/libsrc/citrus_module.c	2025-02-18 18:03:13.520405718 +0100
+++ dcmtk-3.6.9/oficonv/libsrc/citrus_module.c	2025-02-18 18:05:52.961086427 +0100
@@ -98,7 +98,15 @@
 #endif
 #include <errno.h>
 #include <limits.h>
+
+#if (_MSC_VER >= 1900)
 #include <stdbool.h>
+#else
+#define bool int
+#define false 0
+#define true 1
+#endif
+
 #include <stddef.h>
 #include <stdio.h>
 #include <stdlib.h>
diff -urEb dcmtk-3.6.9.orig/oficonv/libsrc/citrus_mskanji.c dcmtk-3.6.9/oficonv/libsrc/citrus_mskanji.c
--- dcmtk-3.6.9.orig/oficonv/libsrc/citrus_mskanji.c	2025-02-18 18:03:13.519405733 +0100
+++ dcmtk-3.6.9/oficonv/libsrc/citrus_mskanji.c	2025-02-18 18:05:52.961086427 +0100
@@ -67,7 +67,15 @@
 
 #include <errno.h>
 #include <limits.h>
+
+#if (_MSC_VER >= 1900)
 #include <stdbool.h>
+#else
+#define bool int
+#define false 0
+#define true 1
+#endif
+
 #include <stddef.h>
 #include <stdio.h>
 #include <stdlib.h>
diff -urEb dcmtk-3.6.9.orig/oficonv/libsrc/citrus_prop.c dcmtk-3.6.9/oficonv/libsrc/citrus_prop.c
--- dcmtk-3.6.9.orig/oficonv/libsrc/citrus_prop.c	2025-02-18 18:03:13.514405812 +0100
+++ dcmtk-3.6.9/oficonv/libsrc/citrus_prop.c	2025-02-18 18:05:52.961086427 +0100
@@ -30,7 +30,15 @@
 
 #include <errno.h>
 #include <limits.h>
+
+#if (_MSC_VER >= 1900)
 #include <stdbool.h>
+#else
+#define bool int
+#define false 0
+#define true 1
+#endif
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
diff -urEb dcmtk-3.6.9.orig/oficonv/libsrc/citrus_region.h dcmtk-3.6.9/oficonv/libsrc/citrus_region.h
--- dcmtk-3.6.9.orig/oficonv/libsrc/citrus_region.h	2025-02-18 18:03:13.516405780 +0100
+++ dcmtk-3.6.9/oficonv/libsrc/citrus_region.h	2025-02-18 18:05:52.961086427 +0100
@@ -31,7 +31,14 @@
 #include "dcmtk/config/osconfig.h"
 #include <stdint.h>
 #include <string.h>
+
+#if (_MSC_VER >= 1900)
 #include <stdbool.h>
+#else
+#define bool int
+#define false 0
+#define true 1
+#endif
 
 #ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
diff -urEb dcmtk-3.6.9.orig/oficonv/libsrc/citrus_utf8.c dcmtk-3.6.9/oficonv/libsrc/citrus_utf8.c
--- dcmtk-3.6.9.orig/oficonv/libsrc/citrus_utf8.c	2025-02-18 18:03:13.519405733 +0100
+++ dcmtk-3.6.9/oficonv/libsrc/citrus_utf8.c	2025-02-18 18:05:52.961086427 +0100
@@ -66,7 +66,15 @@
 
 #include <errno.h>
 #include <limits.h>
+
+#if (_MSC_VER >= 1900)
 #include <stdbool.h>
+#else
+#define bool int
+#define false 0
+#define true 1
+#endif
+
 #include <stddef.h>
 #include <stdio.h>
 #include <stdlib.h>
diff -urEb dcmtk-3.6.9.orig/oficonv/libsrc/oficonv_iconv.c dcmtk-3.6.9/oficonv/libsrc/oficonv_iconv.c
--- dcmtk-3.6.9.orig/oficonv/libsrc/oficonv_iconv.c	2025-02-18 18:03:13.512405843 +0100
+++ dcmtk-3.6.9/oficonv/libsrc/oficonv_iconv.c	2025-02-18 18:05:52.962086413 +0100
@@ -40,7 +40,15 @@
 
 #include <errno.h>
 #include <limits.h>
+
+#if (_MSC_VER >= 1900)
 #include <stdbool.h>
+#else
+#define bool int
+#define false 0
+#define true 1
+#endif
+
 #include <stdlib.h>
 #include <string.h>
 #include <stdio.h>
diff -urEb dcmtk-3.6.9.orig/oficonv/libsrc/windows_mmap.h dcmtk-3.6.9/oficonv/libsrc/windows_mmap.h
--- dcmtk-3.6.9.orig/oficonv/libsrc/windows_mmap.h	2025-02-18 18:03:13.511405858 +0100
+++ dcmtk-3.6.9/oficonv/libsrc/windows_mmap.h	2025-02-18 18:05:52.962086413 +0100
@@ -74,6 +74,12 @@
 
 static void *mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset)
 {
+  DWORD flProtect;
+  DWORD dwDesiredAccess;
+  HANDLE mmap_fd, h;
+  off_t end;
+  void *ret;
+
     (void) start;
 
 	if (prot & ~(PROT_READ | PROT_WRITE | PROT_EXEC))
@@ -84,7 +90,6 @@
 	} else if (flags & MAP_ANON)
 		return MAP_FAILED;
 
-	DWORD flProtect;
     flProtect = 0;
 	if (prot & PROT_WRITE) {
 		if (prot & PROT_EXEC)
@@ -99,8 +104,7 @@
 	} else
 		flProtect = PAGE_READONLY;
 
-	off_t end = (off_t)(length + offset);
-	HANDLE mmap_fd, h;
+	end = (off_t)(length + offset);
 	if (fd == -1)
 		mmap_fd = INVALID_HANDLE_VALUE;
 	else
@@ -109,7 +113,6 @@
 	if (h == NULL)
 		return MAP_FAILED;
 
-	DWORD dwDesiredAccess;
 	if (prot & PROT_WRITE)
 		dwDesiredAccess = FILE_MAP_WRITE;
 	else
@@ -118,7 +121,7 @@
 		dwDesiredAccess |= FILE_MAP_EXECUTE;
 	if (flags & MAP_PRIVATE)
 		dwDesiredAccess |= FILE_MAP_COPY;
-	void *ret = MapViewOfFile(h, dwDesiredAccess, MM_DWORD_HI(offset), MM_DWORD_LO(offset), length);
+	ret = MapViewOfFile(h, dwDesiredAccess, MM_DWORD_HI(offset), MM_DWORD_LO(offset), length);
 	if (ret == NULL) {
 		CloseHandle(h);
 		ret = MAP_FAILED;
@@ -140,11 +143,13 @@
 
 static void munmap(void *addr, size_t length)
 {
+  mmap_cleanup_t **prevPtr;
+  mmap_cleanup_t *mc;
+
     (void) length;
 	UnmapViewOfFile(addr);
 	// Look up through the tracking elements to close the handle
-	mmap_cleanup_t **prevPtr = &mmap_cleanup;
-	mmap_cleanup_t *mc;
+	prevPtr = &mmap_cleanup;
 	for (mc = *prevPtr; mc != NULL; prevPtr = &mc->next, mc = *prevPtr)
 	{
 		if (mc->addr == addr)
diff -urEb dcmtk-3.6.9.orig/ofstd/include/dcmtk/ofstd/oftypes.h dcmtk-3.6.9/ofstd/include/dcmtk/ofstd/oftypes.h
--- dcmtk-3.6.9.orig/ofstd/include/dcmtk/ofstd/oftypes.h	2025-02-18 18:03:13.523405671 +0100
+++ dcmtk-3.6.9/ofstd/include/dcmtk/ofstd/oftypes.h	2025-02-18 18:05:52.962086413 +0100
@@ -79,10 +79,9 @@
 
 #include <cstddef>
 BEGIN_EXTERN_C
-#ifdef HAVE_STDINT_H
+#if defined(HAVE_STDINT_H) || _MSC_VER >= 1600
 #include <stdint.h>
 #endif
-#include <inttypes.h>
 END_EXTERN_C
 
 #include "dcmtk/ofstd/ofstream.h"
