Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Unified Diff: third_party/libtiff/tiffiop.h

Issue 1563103002: XFA: Upgrade to libtiff 4.0.6. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: rename to libtiff Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/libtiff/tiffio.h ('k') | third_party/libtiff/uvcode.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/libtiff/tiffiop.h
diff --git a/third_party/tiff_v403/tiffiop.h b/third_party/libtiff/tiffiop.h
similarity index 86%
rename from third_party/tiff_v403/tiffiop.h
rename to third_party/libtiff/tiffiop.h
index c5ddc3c173195fced33b578fdf541dd62fef1531..c647b8df3b677c91f7b7bf9b1ca4cd326528843c 100644
--- a/third_party/tiff_v403/tiffiop.h
+++ b/third_party/libtiff/tiffiop.h
@@ -1,4 +1,4 @@
-/* $Id: tiffiop.h,v 1.84 2012-05-30 01:50:17 fwarmerdam Exp $ */
+/* $Id: tiffiop.h,v 1.87 2015-08-23 17:49:01 bfriesen Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
@@ -57,6 +57,12 @@ extern void *lfind(const void *, const void *, size_t *, size_t,
int (*)(const void *, const void *));
#endif
+#if !defined(HAVE_SNPRINTF) && !defined(HAVE__SNPRINTF)
+#undef snprintf
+#define snprintf _TIFF_snprintf_f
+extern int snprintf(char* str, size_t size, const char* format, ...);
+#endif
+
#include "tiffio.h"
#include "tif_dir.h"
@@ -258,6 +264,53 @@ struct tiff {
#define TIFFArrayCount(a) (sizeof (a) / sizeof ((a)[0]))
+/*
+ Support for large files.
+
+ Windows read/write APIs support only 'unsigned int' rather than 'size_t'.
+ Windows off_t is only 32-bit, even in 64-bit builds.
+*/
+#if defined(HAVE_FSEEKO)
+/*
+ Use fseeko() and ftello() if they are available since they use
+ 'off_t' rather than 'long'. It is wrong to use fseeko() and
+ ftello() only on systems with special LFS support since some systems
+ (e.g. FreeBSD) support a 64-bit off_t by default.
+
+ For MinGW, __MSVCRT_VERSION__ must be at least 0x800 to expose these
+ interfaces. The MinGW compiler must support the requested version. MinGW
+ does not distribute the CRT (it is supplied by Microsoft) so the correct CRT
+ must be available on the target computer in order for the program to run.
+*/
+#if defined(HAVE_FSEEKO)
+# define fseek(stream,offset,whence) fseeko(stream,offset,whence)
+# define ftell(stream,offset,whence) ftello(stream,offset,whence)
+#endif
+#endif
+#if defined(__WIN32__) && \
+ !(defined(_MSC_VER) && _MSC_VER < 1400) && \
+ !(defined(__MSVCRT_VERSION__) && __MSVCRT_VERSION__ < 0x800)
+typedef unsigned int TIFFIOSize_t;
+#define _TIFF_lseek_f(fildes,offset,whence) _lseeki64(fildes,/* __int64 */ offset,whence)
+/* #define _TIFF_tell_f(fildes) /\* __int64 *\/ _telli64(fildes) */
+#define _TIFF_fseek_f(stream,offset,whence) _fseeki64(stream,/* __int64 */ offset,whence)
+#define _TIFF_fstat_f(fildes,stat_buff) _fstati64(fildes,/* struct _stati64 */ stat_buff)
+/* #define _TIFF_ftell_f(stream) /\* __int64 *\/ _ftelli64(stream) */
+/* #define _TIFF_stat_f(path,stat_buff) _stati64(path,/\* struct _stati64 *\/ stat_buff) */
+#define _TIFF_stat_s struct _stati64
+#define _TIFF_off_t __int64
+#else
+typedef size_t TIFFIOSize_t;
+#define _TIFF_lseek_f(fildes,offset,whence) lseek(fildes,offset,whence)
+/* #define _TIFF_tell_f(fildes) (_TIFF_lseek_f(fildes,0,SEEK_CUR)) */
+#define _TIFF_fseek_f(stream,offset,whence) fseek(stream,offset,whence)
+#define _TIFF_fstat_f(fildes,stat_buff) fstat(fildes,stat_buff)
+/* #define _TIFF_ftell_f(stream) ftell(stream) */
+/* #define _TIFF_stat_f(path,stat_buff) stat(path,stat_buff) */
+#define _TIFF_stat_s struct stat
+#define _TIFF_off_t off_t
+#endif
+
#if defined(__cplusplus)
extern "C" {
#endif
« no previous file with comments | « third_party/libtiff/tiffio.h ('k') | third_party/libtiff/uvcode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698