libtiff: don't try to export symbols from newer versions

From 7bdb4ddd311d9ea71b92dfd8d74c1a20f794def4 Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Sat, 21 Oct 2023 23:33:32 +0300
Subject: [PATCH] don't try to export symbols from newer versions

---
 libtiff/libtiff.def | 2 --
 libtiff/tif_aux.c   | 9 ---------
 libtiff/tiffio.h    | 1 -
 libtiff/tiffiop.h   | 2 +-
 tools/tiffcrop.c    | 8 ++++++++
 5 files changed, 9 insertions(+), 13 deletions(-)

diff --git a/libtiff/libtiff.def b/libtiff/libtiff.def
index 3f4380cb..b2d03fe7 100644
--- a/libtiff/libtiff.def
+++ b/libtiff/libtiff.def
@@ -29,7 +29,6 @@ EXPORTS	TIFFAccessTagMethods
 	TIFFFieldName
 	TIFFFieldPassCount
 	TIFFFieldReadCount
-	TIFFFieldIsAnonymous
 	TIFFFieldTag
 	TIFFFieldWithName
 	TIFFFieldWithTag
@@ -167,7 +166,6 @@ EXPORTS	TIFFAccessTagMethods
 	TIFFYCbCrtoRGB
 	_TIFFCheckMalloc
 	_TIFFCheckRealloc
-	_TIFFClampDoubleToUInt32
 	_TIFFRewriteField
 	_TIFFfree
 	_TIFFmalloc
diff --git a/libtiff/tif_aux.c b/libtiff/tif_aux.c
index 1813452d..c9f19054 100644
--- a/libtiff/tif_aux.c
+++ b/libtiff/tif_aux.c
@@ -409,15 +409,6 @@ int _TIFFSeekOK(TIFF* tif, toff_t off)
     return off <= (~(uint64)0)/2 && TIFFSeekFile(tif,off,SEEK_SET)==off;
 }
 
-uint32 _TIFFClampDoubleToUInt32(double val)
-{
-    if( val < 0 )
-        return 0;
-    if( val > 0xFFFFFFFFU || val != val )
-        return 0xFFFFFFFFU;
-    return (uint32)val;
-}
-
 /* vim: set ts=8 sts=8 sw=8 noet: */
 /*
  * Local Variables:
diff --git a/libtiff/tiffio.h b/libtiff/tiffio.h
index 558f4365..9eac2494 100644
--- a/libtiff/tiffio.h
+++ b/libtiff/tiffio.h
@@ -326,7 +326,6 @@ extern TIFFDataType TIFFFieldDataType(const TIFFField*);
 extern int TIFFFieldPassCount(const TIFFField*);
 extern int TIFFFieldReadCount(const TIFFField*);
 extern int TIFFFieldWriteCount(const TIFFField*);
-extern int TIFFFieldIsAnonymous(const TIFFField *);
 
 typedef int (*TIFFVSetMethod)(TIFF*, uint32, va_list);
 typedef int (*TIFFVGetMethod)(TIFF*, uint32, va_list);
diff --git a/libtiff/tiffiop.h b/libtiff/tiffiop.h
index cf50d56c..e875ca68 100644
--- a/libtiff/tiffiop.h
+++ b/libtiff/tiffiop.h
@@ -366,6 +366,7 @@ extern int TIFFSetDefaultCompressionState(TIFF* tif);
 extern uint32 _TIFFDefaultStripSize(TIFF* tif, uint32 s);
 extern void _TIFFDefaultTileSize(TIFF* tif, uint32* tw, uint32* th);
 extern int _TIFFDataSize(TIFFDataType type);
+extern int TIFFFieldIsAnonymous(const TIFFField*);
 
 /*--: Rational2Double: Return size of TIFFSetGetFieldType in bytes. */
 extern int _TIFFSetGetFieldSize(TIFFSetGetFieldType setgettype);
@@ -394,7 +395,6 @@ extern void* _TIFFCheckRealloc(TIFF*, void*, tmsize_t, tmsize_t, const char*);
 
 extern double _TIFFUInt64ToDouble(uint64);
 extern float _TIFFUInt64ToFloat(uint64);
-extern uint32 _TIFFClampDoubleToUInt32(double);
 
 extern float _TIFFClampDoubleToFloat(double);
 
diff --git a/tools/tiffcrop.c b/tools/tiffcrop.c
index 132fb0e0..05194c85 100644
--- a/tools/tiffcrop.c
+++ b/tools/tiffcrop.c
@@ -5181,6 +5181,14 @@ static void initDumpOptions(struct dump_opts *dump)
   dump->outfile = NULL;
   }
 
+static uint32 _TIFFClampDoubleToUInt32(double val)
+{
+    if (val < 0)
+        return 0;
+    if (val > 0xFFFFFFFFU || val != val)
+        return 0xFFFFFFFFU;
+    return (uint32)val;
+}
 /* Compute pixel offsets into the image for margins and fixed regions */
 static int
 computeInputPixelOffsets(struct crop_mask *crop, struct image_data *image,