summaryrefslogtreecommitdiff
path: root/third_party/libtiff/tiffconf.h
diff options
context:
space:
mode:
authorNicolas Pena <npm@chromium.org>2017-07-27 15:52:36 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-07-27 21:18:34 +0000
commitd4362fe972442cfd2d6aa9b32134240c0ddaa6c5 (patch)
tree5975131a491697ccbb3f78b37e27cffe3e315ce5 /third_party/libtiff/tiffconf.h
parent33805cc811c722a0c5cd439cff419de252cd39c9 (diff)
downloadpdfium-d4362fe972442cfd2d6aa9b32134240c0ddaa6c5.tar.xz
Define SIZEOF_VOIDP and other cleanup in tiffconf
This CL uses sizeof to calculate sizes in tiffconf. It adds SIZEOF_VOIDP to allow LibTIFF to take codepaths reducing OOMs. Finally, it gets rid of _FX_WIN32_MOBILE_ since it's never defined. Bug: chromium:718494 Change-Id: I9e6fb2812487ccd7d08e56fd1954c716ddccd07b Reviewed-on: https://pdfium-review.googlesource.com/9410 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Nicolás Peña <npm@chromium.org>
Diffstat (limited to 'third_party/libtiff/tiffconf.h')
-rw-r--r--third_party/libtiff/tiffconf.h28
1 files changed, 8 insertions, 20 deletions
diff --git a/third_party/libtiff/tiffconf.h b/third_party/libtiff/tiffconf.h
index 26de163aba..2a88cb75f4 100644
--- a/third_party/libtiff/tiffconf.h
+++ b/third_party/libtiff/tiffconf.h
@@ -12,18 +12,8 @@
//NOTE: The tiff codec requires an ANSI C compiler environment for building and
// presumes an ANSI C environment for use.
-/* Define to 1 if you have the <fcntl.h> header file. */
-/* Define to 1 if you have the <sys/types.h> header file. */
-#if _FX_OS_ == _FX_WIN32_MOBILE_
-# define O_RDONLY 0x0000 /* open for reading only */
-# define O_WRONLY 0x0001 /* open for writing only */
-# define O_RDWR 0x0002 /* open for reading and writing */
-# define O_CREAT 0x0100 /* create and open file */
-# define O_TRUNC 0x0200 /* open and truncate */
-#else
# define HAVE_SYS_TYPES_H 1
# define HAVE_FCNTL_H 1
-#endif
/* Compatibility stuff. */
@@ -45,19 +35,17 @@
#define HAVE_SEARCH_H 1
#endif
+static const size_t sizeOfInt = sizeof(int);
/* The size of a `int', as computed by sizeof. */
-/* According typedef int int32_t; in the fx_system.h*/
-#define SIZEOF_INT 4
+#define SIZEOF_INT sizeOfInt
-/* Sunliang.Liu 20110325. We should config the correct long size for tif
- fax4decode optimize in tif_fax3.c -- Linux64 decode issue.
- TESTDOC: Bug #23661 - z1.tif. */
-#if _FX_CPU_ == _FX_WIN64_ || _FX_CPU_ == _FX_X64_ || _FX_CPU_ == _FX_IA64_
+static const size_t sizeOfULong = sizeof(unsigned long);
/* The size of `unsigned long', as computed by sizeof. */
-#define SIZEOF_UNSIGNED_LONG 8
-#else
-#define SIZEOF_UNSIGNED_LONG 4
-#endif
+#define SIZEOF_UNSIGNED_LONG sizeOfULong
+
+static const size_t sizeOfVoidP = sizeof(void*);
+/* The size of void* as computed by sizeof. */
+#define SIZEOF_VOIDP sizeOfVoidP
/* Signed 8-bit type */
#define TIFF_INT8_T signed char