https://github.com/libsdl-org/libtiff/commit/f6d9fa93e7965246404edc9be4db2c3fd33a755e
From f6d9fa93e7965246404edc9be4db2c3fd33a755e Mon Sep 17 00:00:00 2001
From: Bob Friesenhahn <[EMAIL REDACTED]>
Date: Tue, 6 Jan 2009 19:08:09 +0000
Subject: [PATCH] * libtiff/tiffiop.h: Add private type declarations for int64,
and uint64 so that bundled utilities (like tiffcrop) can use it when
necessary.
---
ChangeLog | 6 ++++++
libtiff/tiffiop.h | 35 ++++++++++++++++++-----------------
2 files changed, 24 insertions(+), 17 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index befcec0a..1c6374c1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-01-06 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
+
+ * libtiff/tiffiop.h: Add private type declarations for int64, and
+ uint64 so that bundled utilities (like tiffcrop) can use it when
+ necessary.
+
2009-01-01 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
* configure.ac: Updated to test for 64-bit types. This version of
diff --git a/libtiff/tiffiop.h b/libtiff/tiffiop.h
index b66582b7..004b8e7e 100644
--- a/libtiff/tiffiop.h
+++ b/libtiff/tiffiop.h
@@ -1,4 +1,4 @@
-/* $Id: tiffiop.h,v 1.52 2007-03-17 04:41:29 joris Exp $ */
+/* $Id: tiffiop.h,v 1.51.2.1 2009-01-06 19:08:09 bfriesen Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
@@ -57,6 +57,13 @@ extern void *lfind(const void *, const void *, size_t *, size_t,
int (*)(const void *, const void *));
#endif
+/*
+ Libtiff itself does not require a 64-bit type, but bundled TIFF
+ utilities may use it.
+*/
+typedef TIFF_INT64_T int64;
+typedef TIFF_UINT64_T uint64;
+
#include "tiffio.h"
#include "tif_dir.h"
@@ -93,10 +100,10 @@ typedef uint32 (*TIFFStripMethod)(TIFF*, uint32);
typedef void (*TIFFTileMethod)(TIFF*, uint32*, uint32*);
struct tiff {
- char* tif_name; /* name of open file */
- int tif_fd; /* open file descriptor */
- int tif_mode; /* open mode (O_*) */
- uint32 tif_flags;
+ char* tif_name; /* name of open file */
+ int tif_fd; /* open file descriptor */
+ int tif_mode; /* open mode (O_*) */
+ uint32 tif_flags;
#define TIFF_FILLORDER 0x00003 /* natural bit fill order for machine */
#define TIFF_DIRTYHEADER 0x00004 /* header must be written on close */
#define TIFF_DIRTYDIRECT 0x00008 /* current directory must be written */
@@ -110,29 +117,23 @@ struct tiff {
#define TIFF_MAPPED 0x00800 /* file is mapped into memory */
#define TIFF_POSTENCODE 0x01000 /* need call to postencode routine */
#define TIFF_INSUBIFD 0x02000 /* currently writing a subifd */
-#define TIFF_UPSAMPLED 0x04000 /* library is doing data up-sampling */
+#define TIFF_UPSAMPLED 0x04000 /* library is doing data up-sampling */
#define TIFF_STRIPCHOP 0x08000 /* enable strip chopping support */
#define TIFF_HEADERONLY 0x10000 /* read header only, do not process */
/* the first directory */
#define TIFF_NOREADRAW 0x20000 /* skip reading of raw uncompressed */
/* image data */
#define TIFF_INCUSTOMIFD 0x40000 /* currently writing a custom IFD */
-#define TIFF_BIGTIFF 0x80000 /* read/write bigtiff */
- uint64 tif_diroff; /* file offset of current directory */
- uint64 tif_nextdiroff; /* file offset of following directory */
- uint64* tif_dirlist; /* list of offsets to already seen */
+ toff_t tif_diroff; /* file offset of current directory */
+ toff_t tif_nextdiroff; /* file offset of following directory */
+ toff_t* tif_dirlist; /* list of offsets to already seen */
/* directories to prevent IFD looping */
tsize_t tif_dirlistsize;/* number of entires in offset list */
uint16 tif_dirnumber; /* number of already seen directories */
TIFFDirectory tif_dir; /* internal rep of current directory */
TIFFDirectory tif_customdir; /* custom IFDs are separated from
the main ones */
- union {
- TIFFHeaderCommon common;
- TIFFHeaderClassic classic;
- TIFFHeaderBig big;
- } tif_header;
- uint16 tif_header_size; /* file's header block and its length */
+ TIFFHeader tif_header; /* file's header block */
const int* tif_typeshift; /* data type shift counts */
const long* tif_typemask; /* data type masks */
uint32 tif_row; /* current scanline */
@@ -176,7 +177,7 @@ struct tiff {
tsize_t tif_rawcc; /* bytes unread from raw buffer */
/* memory-mapped file support */
tidata_t tif_base; /* base of mapped file */
- uint64 tif_size; /* size of mapped file region (bytes)
+ toff_t tif_size; /* size of mapped file region (bytes)
FIXME: it should be tsize_t */
TIFFMapFileProc tif_mapproc; /* map file method */
TIFFUnmapFileProc tif_unmapproc;/* unmap file method */