Author: Sergei Golovan
Description: Patch allows one to build libtk-img using the system-wide libtiff.
 This patch adds a hack which sort of ports libtk-img to version 4 of libtiff.
 The patch is a Debian-specific hack and isn't supposed to be forwarded
 upstream.
Last-modified: Sun, 15 Dec 2013 21:03:21 +0400

--- a/libtiff/configure
+++ b/libtiff/configure
@@ -5696,30 +5696,6 @@
 TIFFCC=`echo "$CC" | sed -e 's/-pipe//'`
 TIFFCC=`which $TIFFCC 2>/dev/null`
 
-#--------------------------------------------------------------------
-# Run the configuration of TIFF itself, and do some special checks
-# to if the configuration agrees with the sources of tiff itself.
-# F.e. tiff is hardwired to use "stdarg.h". If the chosen compiler
-# does not support this we have to bail out.
-#--------------------------------------------------------------------
-
-if test `grep STDC_HEADERS confdefs.h | wc -l` -eq 0
-then
-    as_fn_error $? "Compiler does not use stdarg.h, required for TIFF" "$LINENO" 5
-fi
-
-mv -f confdefs.h tifftcl_confdefs.h
-if test "X$host" = X -o "X$host" = XNONE
-then
-    TIFFHOST=""
-else
-    TIFFHOST="$host"
-fi
-${srcdir}/../compat/libtiff/configure --disable-zlib --disable-zstd --disable-lzma \
-	--disable-pixarlog --disable-jpeg --disable-jbig --disable-webp --disable-lerc \
-	"--with-CC=$TIFFCC" $TIFFHOST
-mv -f tifftcl_confdefs.h confdefs.h
-
 #-----------------------------------------------------------------------
 # Specify the C source files to compile in TEA_ADD_SOURCES,
 # public headers that need to be installed in TEA_ADD_HEADERS,
@@ -5765,55 +5741,6 @@
 
 
 
-
-    vars="
-	../compat/libtiff/libtiff/tif_aux.c		../compat/libtiff/libtiff/tif_close.c		../compat/libtiff/libtiff/tif_codec.c
-	../compat/libtiff/libtiff/tif_compress.c	../compat/libtiff/libtiff/tif_dir.c		../compat/libtiff/libtiff/tif_dirinfo.c
-	../compat/libtiff/libtiff/tif_dirread.c	        ../compat/libtiff/libtiff/tif_dirwrite.c	../compat/libtiff/libtiff/tif_dumpmode.c
-	../compat/libtiff/libtiff/tif_error.c		../compat/libtiff/libtiff/tif_fax3.c            ../compat/libtiff/libtiff/tif_hash_set.c
-	../compat/libtiff/libtiff/tif_getimage.c	../compat/libtiff/libtiff/tif_flush.c		../compat/libtiff/libtiff/tif_luv.c
-	../compat/libtiff/libtiff/tif_lzw.c		../compat/libtiff/libtiff/tif_next.c		../compat/libtiff/libtiff/tif_open.c
-	../compat/libtiff/libtiff/tif_packbits.c	../compat/libtiff/libtiff/tif_predict.c	        ../compat/libtiff/libtiff/tif_print.c
-	../compat/libtiff/libtiff/tif_read.c		../compat/libtiff/libtiff/tif_swab.c		../compat/libtiff/libtiff/tif_strip.c
-	../compat/libtiff/libtiff/tif_thunder.c	        ../compat/libtiff/libtiff/tif_tile.c		../compat/libtiff/libtiff/tif_version.c
-	../compat/libtiff/libtiff/tif_warning.c	        ../compat/libtiff/libtiff/tif_write.c
-	../compat/libtiff/libtiff/tif_color.c		../compat/libtiff/libtiff/tif_extension.c       ../compat/libtiff/libtiff/tif_fax3sm.c
-"
-    for i in $vars; do
-	case $i in
-	    \$*)
-		# allow $-var names
-		PKG_SOURCES="$PKG_SOURCES $i"
-		PKG_OBJECTS="$PKG_OBJECTS $i"
-		;;
-	    *)
-		# check for existence - allows for generic/win/unix VPATH
-		# To add more dirs here (like 'src'), you have to update VPATH
-		# in Makefile.in as well
-		if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \
-		    -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \
-		    -a ! -f "${srcdir}/macosx/$i" \
-		    ; then
-		    as_fn_error $? "could not find source file '$i'" "$LINENO" 5
-		fi
-		PKG_SOURCES="$PKG_SOURCES $i"
-		# this assumes it is in a VPATH dir
-		i=`basename $i`
-		# handle user calling this before or after TEA_SETUP_COMPILER
-		if test x"${OBJEXT}" != x ; then
-		    j="`echo $i | sed -e 's/\.[^.]*$//'`.${OBJEXT}"
-		else
-		    j="`echo $i | sed -e 's/\.[^.]*$//'`.\${OBJEXT}"
-		fi
-		PKG_OBJECTS="$PKG_OBJECTS $j"
-		;;
-	esac
-    done
-
-
-
-
-
     vars="tifftcl.h tifftclDecls.h"
     for i in $vars; do
 	# check for existence, be strict because it is installed
@@ -6168,39 +6095,6 @@
 else
     CLEANFILES=""
 
-    vars="../compat/libtiff/libtiff/tif_unix.c"
-    for i in $vars; do
-	case $i in
-	    \$*)
-		# allow $-var names
-		PKG_SOURCES="$PKG_SOURCES $i"
-		PKG_OBJECTS="$PKG_OBJECTS $i"
-		;;
-	    *)
-		# check for existence - allows for generic/win/unix VPATH
-		# To add more dirs here (like 'src'), you have to update VPATH
-		# in Makefile.in as well
-		if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \
-		    -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \
-		    -a ! -f "${srcdir}/macosx/$i" \
-		    ; then
-		    as_fn_error $? "could not find source file '$i'" "$LINENO" 5
-		fi
-		PKG_SOURCES="$PKG_SOURCES $i"
-		# this assumes it is in a VPATH dir
-		i=`basename $i`
-		# handle user calling this before or after TEA_SETUP_COMPILER
-		if test x"${OBJEXT}" != x ; then
-		    j="`echo $i | sed -e 's/\.[^.]*$//'`.${OBJEXT}"
-		else
-		    j="`echo $i | sed -e 's/\.[^.]*$//'`.\${OBJEXT}"
-		fi
-		PKG_OBJECTS="$PKG_OBJECTS $j"
-		;;
-	esac
-    done
-
-
 
 fi
 
--- a/libtiff/configure.ac
+++ b/libtiff/configure.ac
@@ -46,30 +46,6 @@
 TIFFCC=`echo "$CC" | sed -e 's/-pipe//'`
 TIFFCC=`which $TIFFCC 2>/dev/null`
 
-#--------------------------------------------------------------------
-# Run the configuration of TIFF itself, and do some special checks
-# to if the configuration agrees with the sources of tiff itself.
-# F.e. tiff is hardwired to use "stdarg.h". If the chosen compiler
-# does not support this we have to bail out.
-#--------------------------------------------------------------------
-
-if test `grep STDC_HEADERS confdefs.h | wc -l` -eq 0
-then
-    AC_MSG_ERROR([Compiler does not use stdarg.h, required for TIFF])
-fi
-
-mv -f confdefs.h tifftcl_confdefs.h
-if test "X$host" = X -o "X$host" = XNONE
-then
-    TIFFHOST=""
-else
-    TIFFHOST="$host"
-fi
-${srcdir}/../compat/libtiff/configure --disable-zlib --disable-zstd --disable-lzma \
-	--disable-pixarlog --disable-jpeg --disable-jbig --disable-webp --disable-lerc \
-	"--with-CC=$TIFFCC" $TIFFHOST
-mv -f tifftcl_confdefs.h confdefs.h
-
 #-----------------------------------------------------------------------
 # Specify the C source files to compile in TEA_ADD_SOURCES,
 # public headers that need to be installed in TEA_ADD_HEADERS,
@@ -81,20 +57,6 @@
 
 TEA_ADD_SOURCES([tifftcl.c tifftclStubInit.c])
 
-TEA_ADD_SOURCES([
-	../compat/libtiff/libtiff/tif_aux.c		../compat/libtiff/libtiff/tif_close.c		../compat/libtiff/libtiff/tif_codec.c
-	../compat/libtiff/libtiff/tif_compress.c	../compat/libtiff/libtiff/tif_dir.c		../compat/libtiff/libtiff/tif_dirinfo.c
-	../compat/libtiff/libtiff/tif_dirread.c	        ../compat/libtiff/libtiff/tif_dirwrite.c	../compat/libtiff/libtiff/tif_dumpmode.c
-	../compat/libtiff/libtiff/tif_error.c		../compat/libtiff/libtiff/tif_fax3.c            ../compat/libtiff/libtiff/tif_hash_set.c
-	../compat/libtiff/libtiff/tif_getimage.c	../compat/libtiff/libtiff/tif_flush.c		../compat/libtiff/libtiff/tif_luv.c
-	../compat/libtiff/libtiff/tif_lzw.c		../compat/libtiff/libtiff/tif_next.c		../compat/libtiff/libtiff/tif_open.c
-	../compat/libtiff/libtiff/tif_packbits.c	../compat/libtiff/libtiff/tif_predict.c	        ../compat/libtiff/libtiff/tif_print.c
-	../compat/libtiff/libtiff/tif_read.c		../compat/libtiff/libtiff/tif_swab.c		../compat/libtiff/libtiff/tif_strip.c
-	../compat/libtiff/libtiff/tif_thunder.c	        ../compat/libtiff/libtiff/tif_tile.c		../compat/libtiff/libtiff/tif_version.c
-	../compat/libtiff/libtiff/tif_warning.c	        ../compat/libtiff/libtiff/tif_write.c
-	../compat/libtiff/libtiff/tif_color.c		../compat/libtiff/libtiff/tif_extension.c       ../compat/libtiff/libtiff/tif_fax3sm.c
-])
-
 TEA_ADD_HEADERS([tifftcl.h tifftclDecls.h])
 TEA_ADD_INCLUDES([-I\"`\${CYGPATH} \${srcdir}`\"])
 TEA_ADD_INCLUDES([-I\"./libtiff\"])
@@ -132,7 +94,6 @@
     TEA_ADD_SOURCES([../compat/libtiff/libtiff/tif_win32.c])
 else
     CLEANFILES=""
-    TEA_ADD_SOURCES([../compat/libtiff/libtiff/tif_unix.c])
 fi
 AC_SUBST(CLEANFILES)
 
--- a/libtiff/Makefile.in
+++ b/libtiff/Makefile.in
@@ -160,9 +160,9 @@
 CONFIG_CLEAN_FILES = Makefile
 
 CPPFLAGS	= @CPPFLAGS@
-LIBS		= @PKG_LIBS@ @LIBS@
+LIBS		= @PKG_LIBS@ @LIBS@ -ltiff
 AR		= @AR@
-CFLAGS		= @CFLAGS@ -DTIFFTCLAPI=MODULE_SCOPE
+CFLAGS		= @CFLAGS@ -DTIFFTCLAPI=MODULE_SCOPE -DMODULE_SCOPE=extern
 COMPILE		= $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
 
 .SUFFIXES: .c .$(OBJEXT)
--- a/tiff/tiff.c
+++ b/tiff/tiff.c
@@ -169,14 +169,10 @@
         if (!Zlibtcl_InitStubs(interp, ZLIBTCL_VERSION, 0)) {
             return TCL_ERROR;
         }
-        TIFFRegisterCODEC (COMPRESSION_DEFLATE,  "Deflate",  TkimgTIFFInitZip);
-        TIFFRegisterCODEC (COMPRESSION_ADOBE_DEFLATE, "AdobeDeflate", TkimgTIFFInitZip);
 
         if (!Jpegtcl_InitStubs(interp, JPEGTCL_VERSION, 0)) {
             return TCL_ERROR;
         }
-        TIFFRegisterCODEC (COMPRESSION_JPEG,     "JPEG",     TkimgTIFFInitJpeg);
-        TIFFRegisterCODEC (COMPRESSION_PIXARLOG, "PixarLog", TkimgTIFFInitPixar);
     }
     return TCL_OK;
 }
--- a/tiff/configure
+++ b/tiff/configure
@@ -6873,7 +6873,7 @@
 #-----------------------------------------------------------------------
 
 
-    vars="tiff.c tiffJpeg.c tiffZip.c tiffPixar.c"
+    vars="tiff.c"
     for i in $vars; do
 	case $i in
 	    \$*)
--- a/tiff/configure.ac
+++ b/tiff/configure.ac
@@ -75,7 +75,7 @@
 # and PKG_TCL_SOURCES.
 #-----------------------------------------------------------------------
 
-TEA_ADD_SOURCES([tiff.c tiffJpeg.c tiffZip.c tiffPixar.c])
+TEA_ADD_SOURCES([tiff.c])
 TEA_ADD_HEADERS([])
 TEA_ADD_INCLUDES([-I\"`\${CYGPATH} \${srcdir}`\"])
 TEA_ADD_INCLUDES([-I\"`\${CYGPATH} \${tkimg_SRC_PATH}`\"])
--- a/libtiff/tifftcl.decls
+++ b/libtiff/tifftcl.decls
@@ -312,103 +312,21 @@
     uint64_t TIFFGetStrileOffset(TIFF *tif, uint32_t strile)
 }
 
-# Source: tif_predict.h ...
-declare 100 {
-    int TIFFPredictorInit(TIFF *tiffptr)
-}
-declare 101 {
-    int TIFFPredictorCleanup(TIFF *tiffptr)
-}
-
 # Source: tif_dir.h ...
 declare 111 {
     int TIFFMergeFieldInfo(TIFF *tiffptr, const TIFFFieldInfo *a, uint32_t b)
 }
-declare 112 {
-    void _TIFFPrintFieldInfo(TIFF *tiffptr, FILE *a)
-}
 declare 114 {
     const TIFFField *TIFFFieldWithTag(TIFF *tiffptr, uint32_t a)
 }
-declare 115 {
-    int _TIFFMergeFields(TIFF *tiffptr, const TIFFField *a, uint32_t b)
-}
-
 
 # Source: tiffiop.h ...
-
-declare 127 {
-    void _TIFFNoPostDecode(TIFF *tiffptr, tidata_t a, tsize_t b)
-}
-declare 133 {
-    int TIFFFlushData1(TIFF *tiffptr)
-}
 declare 134 {
     void TIFFFreeDirectory(TIFF *tiffptr)
 }
-declare 135 {
-    int TIFFDefaultDirectory(TIFF *tiffptr)
-}
 declare 136 {
     int TIFFSetCompressionScheme(TIFF *tiffptr, int a)
 }
-declare 137 {
-    void _TIFFSetDefaultCompressionState(TIFF *tiffptr)
-}
-declare 138 {
-    uint32_t _TIFFDefaultStripSize(TIFF *tiffptr, uint32_t a)
-}
-declare 140 {
-    void _TIFFsetByteArray(void **a, const void *b, uint32_t c)
-}
-declare 148 {
-    int TIFFInitDumpMode(TIFF *tiffptr, int a)
-}
-declare 149 generic {!PACKBITS_SUPPORT} {
-    int TIFFInitPackBits(TIFF *tiffptr, int a)
-}
-declare 150 generic {!CCITT_SUPPORT} {
-    int TIFFInitCCITTRLE(TIFF *tiffptr, int a)
-}
-declare 151 generic {!CCITT_SUPPORT} {
-    int TIFFInitCCITTRLEW(TIFF *tiffptr, int a)
-}
-declare 152 generic {!CCITT_SUPPORT} {
-    int TIFFInitCCITTFax3(TIFF *tiffptr, int a)
-}
-declare 153 generic {!CCITT_SUPPORT} {
-    int TIFFInitCCITTFax4(TIFF *tiffptr, int a)
-}
-declare 154 generic {!THUNDER_SUPPORT} {
-    int TIFFInitThunderScan(TIFF *tiffptr, int a)
-}
-declare 155 generic {!NEXT_SUPPORT} {
-    int TIFFInitNeXT(TIFF *tiffptr, int a)
-}
-declare 156 generic {!LZW_SUPPORT} {
-    int TIFFInitLZW(TIFF *tiffptr, int a)
-}
-declare 157 generic {!OJPEG_SUPPORT} {
-    int TIFFInitOJPEG(TIFF *tiffptr, int a)
-}
-declare 158 generic {!JPEG_SUPPORT} {
-    int TIFFInitJPEG(TIFF *tiffptr, int a)
-}
-declare 159 generic {!JBIG_SUPPORT} {
-    int TIFFInitJBIG(TIFF *tiffptr, int a)
-}
-declare 160 generic {!ZIP_SUPPORT} {
-    int TIFFInitZIP(TIFF *tiffptr, int a)
-}
-declare 161 generic {!PIXARLOG_SUPPORT} {
-    int TIFFInitPixarLog(TIFF *tiffptr, int a)
-}
-declare 162 generic {!LOGLUV_SUPPORT} {
-    int TIFFInitSGILog(TIFF *tiffptr, int a)
-}
-declare 163 {
-    tmsize_t _TIFFMultiplySSize(TIFF *tiffptr, tmsize_t a, tmsize_t b, const char * c)
-}
 declare 164 {
     void TIFFWarningExt(thandle_t h, const char *a, const char *b, ...)
 }
--- a/libtiff/tifftclDecls.h
+++ b/libtiff/tifftclDecls.h
@@ -35,8 +35,6 @@
 #undef INLINE
 
 #include "../compat/libtiff/libtiff/tiffio.h"
-#include "../compat/libtiff/libtiff/tiffiop.h"
-#include "../compat/libtiff/libtiff/tif_predict.h"
 
 /* !BEGIN!: Do not edit below this line. */
 
@@ -268,10 +266,8 @@
 /* Slot 97 is reserved */
 /* Slot 98 is reserved */
 /* Slot 99 is reserved */
-/* 100 */
-TIFFTCLAPI int		TIFFPredictorInit(TIFF *tiffptr);
-/* 101 */
-TIFFTCLAPI int		TIFFPredictorCleanup(TIFF *tiffptr);
+/* Slot 100 is reserved */
+/* Slot 101 is reserved */
 /* Slot 102 is reserved */
 /* Slot 103 is reserved */
 /* Slot 104 is reserved */
@@ -284,14 +280,11 @@
 /* 111 */
 TIFFTCLAPI int		TIFFMergeFieldInfo(TIFF *tiffptr,
 				const TIFFFieldInfo *a, uint32_t b);
-/* 112 */
-TIFFTCLAPI void		_TIFFPrintFieldInfo(TIFF *tiffptr, FILE *a);
+/* Slot 112 is reserved */
 /* Slot 113 is reserved */
 /* 114 */
 TIFFTCLAPI const TIFFField * TIFFFieldWithTag(TIFF *tiffptr, uint32_t a);
-/* 115 */
-TIFFTCLAPI int		_TIFFMergeFields(TIFF *tiffptr, const TIFFField *a,
-				uint32_t b);
+/* Slot 115 is reserved */
 /* Slot 116 is reserved */
 /* Slot 117 is reserved */
 /* Slot 118 is reserved */
@@ -303,30 +296,22 @@
 /* Slot 124 is reserved */
 /* Slot 125 is reserved */
 /* Slot 126 is reserved */
-/* 127 */
-TIFFTCLAPI void		_TIFFNoPostDecode(TIFF *tiffptr, tidata_t a,
-				tsize_t b);
+/* Slot 127 is reserved */
 /* Slot 128 is reserved */
 /* Slot 129 is reserved */
 /* Slot 130 is reserved */
 /* Slot 131 is reserved */
 /* Slot 132 is reserved */
-/* 133 */
-TIFFTCLAPI int		TIFFFlushData1(TIFF *tiffptr);
+/* Slot 133 is reserved */
 /* 134 */
 TIFFTCLAPI void		TIFFFreeDirectory(TIFF *tiffptr);
-/* 135 */
-TIFFTCLAPI int		TIFFDefaultDirectory(TIFF *tiffptr);
+/* Slot 135 is reserved */
 /* 136 */
 TIFFTCLAPI int		TIFFSetCompressionScheme(TIFF *tiffptr, int a);
-/* 137 */
-TIFFTCLAPI void		_TIFFSetDefaultCompressionState(TIFF *tiffptr);
-/* 138 */
-TIFFTCLAPI uint32_t	_TIFFDefaultStripSize(TIFF *tiffptr, uint32_t a);
+/* Slot 137 is reserved */
+/* Slot 138 is reserved */
 /* Slot 139 is reserved */
-/* 140 */
-TIFFTCLAPI void		_TIFFsetByteArray(void **a, const void *b,
-				uint32_t c);
+/* Slot 140 is reserved */
 /* Slot 141 is reserved */
 /* Slot 142 is reserved */
 /* Slot 143 is reserved */
@@ -334,39 +319,22 @@
 /* Slot 145 is reserved */
 /* Slot 146 is reserved */
 /* Slot 147 is reserved */
-/* 148 */
-TIFFTCLAPI int		TIFFInitDumpMode(TIFF *tiffptr, int a);
-/* 149 */
-TIFFTCLAPI int		TIFFInitPackBits(TIFF *tiffptr, int a);
-/* 150 */
-TIFFTCLAPI int		TIFFInitCCITTRLE(TIFF *tiffptr, int a);
-/* 151 */
-TIFFTCLAPI int		TIFFInitCCITTRLEW(TIFF *tiffptr, int a);
-/* 152 */
-TIFFTCLAPI int		TIFFInitCCITTFax3(TIFF *tiffptr, int a);
-/* 153 */
-TIFFTCLAPI int		TIFFInitCCITTFax4(TIFF *tiffptr, int a);
-/* 154 */
-TIFFTCLAPI int		TIFFInitThunderScan(TIFF *tiffptr, int a);
-/* 155 */
-TIFFTCLAPI int		TIFFInitNeXT(TIFF *tiffptr, int a);
-/* 156 */
-TIFFTCLAPI int		TIFFInitLZW(TIFF *tiffptr, int a);
-/* 157 */
-TIFFTCLAPI int		TIFFInitOJPEG(TIFF *tiffptr, int a);
-/* 158 */
-TIFFTCLAPI int		TIFFInitJPEG(TIFF *tiffptr, int a);
-/* 159 */
-TIFFTCLAPI int		TIFFInitJBIG(TIFF *tiffptr, int a);
-/* 160 */
-TIFFTCLAPI int		TIFFInitZIP(TIFF *tiffptr, int a);
-/* 161 */
-TIFFTCLAPI int		TIFFInitPixarLog(TIFF *tiffptr, int a);
-/* 162 */
-TIFFTCLAPI int		TIFFInitSGILog(TIFF *tiffptr, int a);
-/* 163 */
-TIFFTCLAPI tmsize_t	_TIFFMultiplySSize(TIFF *tiffptr, tmsize_t a,
-				tmsize_t b, const char *c);
+/* Slot 148 is reserved */
+/* Slot 149 is reserved */
+/* Slot 150 is reserved */
+/* Slot 151 is reserved */
+/* Slot 152 is reserved */
+/* Slot 153 is reserved */
+/* Slot 154 is reserved */
+/* Slot 155 is reserved */
+/* Slot 156 is reserved */
+/* Slot 157 is reserved */
+/* Slot 158 is reserved */
+/* Slot 159 is reserved */
+/* Slot 160 is reserved */
+/* Slot 161 is reserved */
+/* Slot 162 is reserved */
+/* Slot 163 is reserved */
 /* 164 */
 TIFFTCLAPI void		TIFFWarningExt(thandle_t h, const char *a,
 				const char *b, ...);
@@ -475,8 +443,8 @@
     void (*reserved97)(void);
     void (*reserved98)(void);
     void (*reserved99)(void);
-    int (*tIFFPredictorInit) (TIFF *tiffptr); /* 100 */
-    int (*tIFFPredictorCleanup) (TIFF *tiffptr); /* 101 */
+    void (*reserved100)(void);
+    void (*reserved101)(void);
     void (*reserved102)(void);
     void (*reserved103)(void);
     void (*reserved104)(void);
@@ -487,10 +455,10 @@
     void (*reserved109)(void);
     void (*reserved110)(void);
     int (*tIFFMergeFieldInfo) (TIFF *tiffptr, const TIFFFieldInfo *a, uint32_t b); /* 111 */
-    void (*_TIFFPrintFieldInfoPtr) (TIFF *tiffptr, FILE *a); /* 112 */
+    void (*reserved112)(void);
     void (*reserved113)(void);
     const TIFFField * (*tIFFFieldWithTag) (TIFF *tiffptr, uint32_t a); /* 114 */
-    int (*_TIFFMergeFieldsPtr) (TIFF *tiffptr, const TIFFField *a, uint32_t b); /* 115 */
+    void (*reserved115)(void);
     void (*reserved116)(void);
     void (*reserved117)(void);
     void (*reserved118)(void);
@@ -502,20 +470,20 @@
     void (*reserved124)(void);
     void (*reserved125)(void);
     void (*reserved126)(void);
-    void (*_TIFFNoPostDecodePtr) (TIFF *tiffptr, tidata_t a, tsize_t b); /* 127 */
+    void (*reserved127)(void);
     void (*reserved128)(void);
     void (*reserved129)(void);
     void (*reserved130)(void);
     void (*reserved131)(void);
     void (*reserved132)(void);
-    int (*tIFFFlushData1) (TIFF *tiffptr); /* 133 */
+    void (*reserved133)(void);
     void (*tIFFFreeDirectory) (TIFF *tiffptr); /* 134 */
-    int (*tIFFDefaultDirectory) (TIFF *tiffptr); /* 135 */
+    void (*reserved135)(void);
     int (*tIFFSetCompressionScheme) (TIFF *tiffptr, int a); /* 136 */
-    void (*_TIFFSetDefaultCompressionStatePtr) (TIFF *tiffptr); /* 137 */
-    uint32_t (*_TIFFDefaultStripSizePtr) (TIFF *tiffptr, uint32_t a); /* 138 */
+    void (*reserved137)(void);
+    void (*reserved138)(void);
     void (*reserved139)(void);
-    void (*_TIFFsetByteArrayPtr) (void **a, const void *b, uint32_t c); /* 140 */
+    void (*reserved140)(void);
     void (*reserved141)(void);
     void (*reserved142)(void);
     void (*reserved143)(void);
@@ -523,22 +491,22 @@
     void (*reserved145)(void);
     void (*reserved146)(void);
     void (*reserved147)(void);
-    int (*tIFFInitDumpMode) (TIFF *tiffptr, int a); /* 148 */
-    int (*tIFFInitPackBits) (TIFF *tiffptr, int a); /* 149 */
-    int (*tIFFInitCCITTRLE) (TIFF *tiffptr, int a); /* 150 */
-    int (*tIFFInitCCITTRLEW) (TIFF *tiffptr, int a); /* 151 */
-    int (*tIFFInitCCITTFax3) (TIFF *tiffptr, int a); /* 152 */
-    int (*tIFFInitCCITTFax4) (TIFF *tiffptr, int a); /* 153 */
-    int (*tIFFInitThunderScan) (TIFF *tiffptr, int a); /* 154 */
-    int (*tIFFInitNeXT) (TIFF *tiffptr, int a); /* 155 */
-    int (*tIFFInitLZW) (TIFF *tiffptr, int a); /* 156 */
-    int (*tIFFInitOJPEG) (TIFF *tiffptr, int a); /* 157 */
-    int (*tIFFInitJPEG) (TIFF *tiffptr, int a); /* 158 */
-    int (*tIFFInitJBIG) (TIFF *tiffptr, int a); /* 159 */
-    int (*tIFFInitZIP) (TIFF *tiffptr, int a); /* 160 */
-    int (*tIFFInitPixarLog) (TIFF *tiffptr, int a); /* 161 */
-    int (*tIFFInitSGILog) (TIFF *tiffptr, int a); /* 162 */
-    tmsize_t (*_TIFFMultiplySSizePtr) (TIFF *tiffptr, tmsize_t a, tmsize_t b, const char *c); /* 163 */
+    void (*reserved148)(void);
+    void (*reserved149)(void);
+    void (*reserved150)(void);
+    void (*reserved151)(void);
+    void (*reserved152)(void);
+    void (*reserved153)(void);
+    void (*reserved154)(void);
+    void (*reserved155)(void);
+    void (*reserved156)(void);
+    void (*reserved157)(void);
+    void (*reserved158)(void);
+    void (*reserved159)(void);
+    void (*reserved160)(void);
+    void (*reserved161)(void);
+    void (*reserved162)(void);
+    void (*reserved163)(void);
     void (*tIFFWarningExt) (thandle_t h, const char *a, const char *b, ...); /* 164 */
 } TifftclStubs;
 
@@ -750,10 +718,8 @@
 /* Slot 97 is reserved */
 /* Slot 98 is reserved */
 /* Slot 99 is reserved */
-#define TIFFPredictorInit \
-	(tifftclStubsPtr->tIFFPredictorInit) /* 100 */
-#define TIFFPredictorCleanup \
-	(tifftclStubsPtr->tIFFPredictorCleanup) /* 101 */
+/* Slot 100 is reserved */
+/* Slot 101 is reserved */
 /* Slot 102 is reserved */
 /* Slot 103 is reserved */
 /* Slot 104 is reserved */
@@ -765,13 +731,11 @@
 /* Slot 110 is reserved */
 #define TIFFMergeFieldInfo \
 	(tifftclStubsPtr->tIFFMergeFieldInfo) /* 111 */
-#define _TIFFPrintFieldInfo \
-	(tifftclStubsPtr->_TIFFPrintFieldInfoPtr) /* 112 */
+/* Slot 112 is reserved */
 /* Slot 113 is reserved */
 #define TIFFFieldWithTag \
 	(tifftclStubsPtr->tIFFFieldWithTag) /* 114 */
-#define _TIFFMergeFields \
-	(tifftclStubsPtr->_TIFFMergeFieldsPtr) /* 115 */
+/* Slot 115 is reserved */
 /* Slot 116 is reserved */
 /* Slot 117 is reserved */
 /* Slot 118 is reserved */
@@ -783,28 +747,22 @@
 /* Slot 124 is reserved */
 /* Slot 125 is reserved */
 /* Slot 126 is reserved */
-#define _TIFFNoPostDecode \
-	(tifftclStubsPtr->_TIFFNoPostDecodePtr) /* 127 */
+/* Slot 127 is reserved */
 /* Slot 128 is reserved */
 /* Slot 129 is reserved */
 /* Slot 130 is reserved */
 /* Slot 131 is reserved */
 /* Slot 132 is reserved */
-#define TIFFFlushData1 \
-	(tifftclStubsPtr->tIFFFlushData1) /* 133 */
+/* Slot 133 is reserved */
 #define TIFFFreeDirectory \
 	(tifftclStubsPtr->tIFFFreeDirectory) /* 134 */
-#define TIFFDefaultDirectory \
-	(tifftclStubsPtr->tIFFDefaultDirectory) /* 135 */
+/* Slot 135 is reserved */
 #define TIFFSetCompressionScheme \
 	(tifftclStubsPtr->tIFFSetCompressionScheme) /* 136 */
-#define _TIFFSetDefaultCompressionState \
-	(tifftclStubsPtr->_TIFFSetDefaultCompressionStatePtr) /* 137 */
-#define _TIFFDefaultStripSize \
-	(tifftclStubsPtr->_TIFFDefaultStripSizePtr) /* 138 */
+/* Slot 137 is reserved */
+/* Slot 138 is reserved */
 /* Slot 139 is reserved */
-#define _TIFFsetByteArray \
-	(tifftclStubsPtr->_TIFFsetByteArrayPtr) /* 140 */
+/* Slot 140 is reserved */
 /* Slot 141 is reserved */
 /* Slot 142 is reserved */
 /* Slot 143 is reserved */
@@ -812,38 +770,22 @@
 /* Slot 145 is reserved */
 /* Slot 146 is reserved */
 /* Slot 147 is reserved */
-#define TIFFInitDumpMode \
-	(tifftclStubsPtr->tIFFInitDumpMode) /* 148 */
-#define TIFFInitPackBits \
-	(tifftclStubsPtr->tIFFInitPackBits) /* 149 */
-#define TIFFInitCCITTRLE \
-	(tifftclStubsPtr->tIFFInitCCITTRLE) /* 150 */
-#define TIFFInitCCITTRLEW \
-	(tifftclStubsPtr->tIFFInitCCITTRLEW) /* 151 */
-#define TIFFInitCCITTFax3 \
-	(tifftclStubsPtr->tIFFInitCCITTFax3) /* 152 */
-#define TIFFInitCCITTFax4 \
-	(tifftclStubsPtr->tIFFInitCCITTFax4) /* 153 */
-#define TIFFInitThunderScan \
-	(tifftclStubsPtr->tIFFInitThunderScan) /* 154 */
-#define TIFFInitNeXT \
-	(tifftclStubsPtr->tIFFInitNeXT) /* 155 */
-#define TIFFInitLZW \
-	(tifftclStubsPtr->tIFFInitLZW) /* 156 */
-#define TIFFInitOJPEG \
-	(tifftclStubsPtr->tIFFInitOJPEG) /* 157 */
-#define TIFFInitJPEG \
-	(tifftclStubsPtr->tIFFInitJPEG) /* 158 */
-#define TIFFInitJBIG \
-	(tifftclStubsPtr->tIFFInitJBIG) /* 159 */
-#define TIFFInitZIP \
-	(tifftclStubsPtr->tIFFInitZIP) /* 160 */
-#define TIFFInitPixarLog \
-	(tifftclStubsPtr->tIFFInitPixarLog) /* 161 */
-#define TIFFInitSGILog \
-	(tifftclStubsPtr->tIFFInitSGILog) /* 162 */
-#define _TIFFMultiplySSize \
-	(tifftclStubsPtr->_TIFFMultiplySSizePtr) /* 163 */
+/* Slot 148 is reserved */
+/* Slot 149 is reserved */
+/* Slot 150 is reserved */
+/* Slot 151 is reserved */
+/* Slot 152 is reserved */
+/* Slot 153 is reserved */
+/* Slot 154 is reserved */
+/* Slot 155 is reserved */
+/* Slot 156 is reserved */
+/* Slot 157 is reserved */
+/* Slot 158 is reserved */
+/* Slot 159 is reserved */
+/* Slot 160 is reserved */
+/* Slot 161 is reserved */
+/* Slot 162 is reserved */
+/* Slot 163 is reserved */
 #define TIFFWarningExt \
 	(tifftclStubsPtr->tIFFWarningExt) /* 164 */
 
--- a/libtiff/tifftclStubInit.c
+++ b/libtiff/tifftclStubInit.c
@@ -120,8 +120,8 @@
     0, /* 97 */
     0, /* 98 */
     0, /* 99 */
-    TIFFPredictorInit, /* 100 */
-    TIFFPredictorCleanup, /* 101 */
+    0, /* 100 */
+    0, /* 101 */
     0, /* 102 */
     0, /* 103 */
     0, /* 104 */
@@ -132,10 +132,10 @@
     0, /* 109 */
     0, /* 110 */
     TIFFMergeFieldInfo, /* 111 */
-    _TIFFPrintFieldInfo, /* 112 */
+    0, /* 112 */
     0, /* 113 */
     TIFFFieldWithTag, /* 114 */
-    _TIFFMergeFields, /* 115 */
+    0, /* 115 */
     0, /* 116 */
     0, /* 117 */
     0, /* 118 */
@@ -147,20 +147,20 @@
     0, /* 124 */
     0, /* 125 */
     0, /* 126 */
-    _TIFFNoPostDecode, /* 127 */
+    0, /* 127 */
     0, /* 128 */
     0, /* 129 */
     0, /* 130 */
     0, /* 131 */
     0, /* 132 */
-    TIFFFlushData1, /* 133 */
+    0, /* 133 */
     TIFFFreeDirectory, /* 134 */
-    TIFFDefaultDirectory, /* 135 */
+    0, /* 135 */
     TIFFSetCompressionScheme, /* 136 */
-    _TIFFSetDefaultCompressionState, /* 137 */
-    _TIFFDefaultStripSize, /* 138 */
+    0, /* 137 */
+    0, /* 138 */
     0, /* 139 */
-    _TIFFsetByteArray, /* 140 */
+    0, /* 140 */
     0, /* 141 */
     0, /* 142 */
     0, /* 143 */
@@ -168,78 +168,22 @@
     0, /* 145 */
     0, /* 146 */
     0, /* 147 */
-    TIFFInitDumpMode, /* 148 */
-#if !defined(PACKBITS_SUPPORT)
+    0, /* 148 */
     0, /* 149 */
-#else  /* !PACKBITS_SUPPORT */
-    TIFFInitPackBits, /* 149 */
-#endif /* !PACKBITS_SUPPORT */
-#if !defined(CCITT_SUPPORT)
     0, /* 150 */
-#else  /* !CCITT_SUPPORT */
-    TIFFInitCCITTRLE, /* 150 */
-#endif /* !CCITT_SUPPORT */
-#if !defined(CCITT_SUPPORT)
     0, /* 151 */
-#else  /* !CCITT_SUPPORT */
-    TIFFInitCCITTRLEW, /* 151 */
-#endif /* !CCITT_SUPPORT */
-#if !defined(CCITT_SUPPORT)
     0, /* 152 */
-#else  /* !CCITT_SUPPORT */
-    TIFFInitCCITTFax3, /* 152 */
-#endif /* !CCITT_SUPPORT */
-#if !defined(CCITT_SUPPORT)
     0, /* 153 */
-#else  /* !CCITT_SUPPORT */
-    TIFFInitCCITTFax4, /* 153 */
-#endif /* !CCITT_SUPPORT */
-#if !defined(THUNDER_SUPPORT)
     0, /* 154 */
-#else  /* !THUNDER_SUPPORT */
-    TIFFInitThunderScan, /* 154 */
-#endif /* !THUNDER_SUPPORT */
-#if !defined(NEXT_SUPPORT)
     0, /* 155 */
-#else  /* !NEXT_SUPPORT */
-    TIFFInitNeXT, /* 155 */
-#endif /* !NEXT_SUPPORT */
-#if !defined(LZW_SUPPORT)
     0, /* 156 */
-#else  /* !LZW_SUPPORT */
-    TIFFInitLZW, /* 156 */
-#endif /* !LZW_SUPPORT */
-#if !defined(OJPEG_SUPPORT)
     0, /* 157 */
-#else  /* !OJPEG_SUPPORT */
-    TIFFInitOJPEG, /* 157 */
-#endif /* !OJPEG_SUPPORT */
-#if !defined(JPEG_SUPPORT)
     0, /* 158 */
-#else  /* !JPEG_SUPPORT */
-    TIFFInitJPEG, /* 158 */
-#endif /* !JPEG_SUPPORT */
-#if !defined(JBIG_SUPPORT)
     0, /* 159 */
-#else  /* !JBIG_SUPPORT */
-    TIFFInitJBIG, /* 159 */
-#endif /* !JBIG_SUPPORT */
-#if !defined(ZIP_SUPPORT)
     0, /* 160 */
-#else  /* !ZIP_SUPPORT */
-    TIFFInitZIP, /* 160 */
-#endif /* !ZIP_SUPPORT */
-#if !defined(PIXARLOG_SUPPORT)
     0, /* 161 */
-#else  /* !PIXARLOG_SUPPORT */
-    TIFFInitPixarLog, /* 161 */
-#endif /* !PIXARLOG_SUPPORT */
-#if !defined(LOGLUV_SUPPORT)
     0, /* 162 */
-#else  /* !LOGLUV_SUPPORT */
-    TIFFInitSGILog, /* 162 */
-#endif /* !LOGLUV_SUPPORT */
-    _TIFFMultiplySSize, /* 163 */
+    0, /* 163 */
     TIFFWarningExt, /* 164 */
 };
 
