libtiff: Merge branch 'libjpeg_turbo_3_0' into 'master'

From a56c5a09751087f8f1e3d8eb08091b8c92a4af38 Mon Sep 17 00:00:00 2001
From: Even Rouault <[EMAIL REDACTED]>
Date: Wed, 24 Apr 2024 22:40:51 +0200
Subject: [PATCH] Change messages/comments refering libjpeg-turbo 2.2 to 3.0

libjpeg-turbo 2.2 was actually released as 3.0. Reflect that
---
 CMakeLists.txt     | 2 +-
 configure.ac       | 8 ++++----
 libtiff/tif_jpeg.c | 6 +++---
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index cdd54950..60403226 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -213,7 +213,7 @@ else()
   message(STATUS "  Old JPEG support:                   Requested:${old-jpeg} Availability:${JPEG_SUPPORT} Support:${OJPEG_SUPPORT} (Depends on JPEG Support)")
 endif()
 if(JPEG_SUPPORT AND HAVE_JPEGTURBO_DUAL_MODE_8_12)
-  message(STATUS "  JPEG 8/12 bit dual mode:            Support: yes (libjpeg turbo >= 2.2 dual mode)")
+  message(STATUS "  JPEG 8/12 bit dual mode:            Support: yes (libjpeg turbo >= 3.0 dual mode)")
 else()
   message(STATUS "  JPEG 8/12 bit dual mode:            Requested:${jpeg12} Availability:${JPEG12_FOUND} Support:${JPEG_DUAL_MODE_8_12}")
 endif()
diff --git a/configure.ac b/configure.ac
index d4e65c69..c88b5134 100644
--- a/configure.ac
+++ b/configure.ac
@@ -583,7 +583,7 @@ if test "x$enable_jpeg" != "xno" ; then
   fi
 
   if test "$jpeg_lib" = "yes" -a "$jpeg_h" = "yes" ; then
-    dnl Check for jpeg12_read_scanlines which has been added in libjpeg-turbo 2.2
+    dnl Check for jpeg12_read_scanlines which has been added in libjpeg-turbo 3.0
     dnl for dual 8/12 bit mode.
     AC_CHECK_LIB(jpeg, jpeg12_read_scanlines, [HAVE_JPEGTURBO_DUAL_MODE_8_12=yes], [HAVE_JPEGTURBO_DUAL_MODE_8_12=no],)
     HAVE_JPEG=yes
@@ -602,7 +602,7 @@ if test "$HAVE_JPEG" = "yes" ; then
   fi
 
   if test "$HAVE_JPEGTURBO_DUAL_MODE_8_12" = "yes"; then
-      AC_DEFINE(HAVE_JPEGTURBO_DUAL_MODE_8_12,1,[libjpeg-turbo >= 2.2 dual mode enabled])
+      AC_DEFINE(HAVE_JPEGTURBO_DUAL_MODE_8_12,1,[libjpeg-turbo >= 3.0 dual mode enabled])
   fi
 fi
 
@@ -917,7 +917,7 @@ AM_CONDITIONAL(HAVE_WEBP, test "$HAVE_WEBP" = 'yes')
 
 dnl ---------------------------------------------------------------------------
 dnl Should 8/12 bit jpeg mode be enabled?
-dnl This should not be used starting with libjpeg-turbo >= 2.2 that has
+dnl This should not be used starting with libjpeg-turbo >= 3.0 that has
 dnl built-in support for dual mode.
 dnl ---------------------------------------------------------------------------
 
@@ -926,7 +926,7 @@ if test "$HAVE_JPEGTURBO_DUAL_MODE_8_12" = "no"; then
 
     AC_ARG_ENABLE(jpeg12,
               AS_HELP_STRING([--enable-jpeg12],
-                     [enable libjpeg 8/12bit dual mode (not to be used with libjpeg-turbo >= 2.2)]),,)
+                     [enable libjpeg 8/12bit dual mode (not to be used with libjpeg-turbo >= 3.0)]),,)
     AC_ARG_WITH(jpeg12-include-dir,
             AS_HELP_STRING([--with-jpeg12-include-dir=DIR],
                    [location of libjpeg 12bit headers]),,)
diff --git a/libtiff/tif_jpeg.c b/libtiff/tif_jpeg.c
index d80bbc6f..cc4967dc 100644
--- a/libtiff/tif_jpeg.c
+++ b/libtiff/tif_jpeg.c
@@ -88,18 +88,18 @@ int TIFFJPEGIsFullStripRequired_12(TIFF *tif);
  * 16bit value?
  */
 
-/* HAVE_JPEGTURBO_DUAL_MODE_8_12 is defined for libjpeg-turbo >= 2.2 which
+/* HAVE_JPEGTURBO_DUAL_MODE_8_12 is defined for libjpeg-turbo >= 3.0 which
  * adds a dual-mode 8/12 bit API in the same library.
  */
 
 #if defined(HAVE_JPEGTURBO_DUAL_MODE_8_12)
 #define JPEG_DUAL_MODE_8_12
 /* Start by undefining BITS_IN_JSAMPLE which is always set to 8 in libjpeg-turbo
- * >= 2.2 Cf
+ * >= 3.0 Cf
  * https://github.com/libjpeg-turbo/libjpeg-turbo/commit/8b9bc4b9635a2a047fb23ebe70c9acd728d3f99b
  */
 #undef BITS_IN_JSAMPLE
-/* libjpeg-turbo >= 2.2 adds J12xxxx datatypes for the 12-bit mode. */
+/* libjpeg-turbo >= 3.0 adds J12xxxx datatypes for the 12-bit mode. */
 #if defined(FROM_TIF_JPEG_12)
 #define BITS_IN_JSAMPLE 12
 #define TIFF_JSAMPLE J12SAMPLE