From ab90f33999b122170f030aa25ef9c72f50286b09 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Thu, 7 Jan 2016 16:21:33 -0800 Subject: XFA: Fix Windows build after upgrading libtiff. TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1570443007 . --- third_party/libtiff/0000-build-config.patch | 16 +++++++++++++++- third_party/libtiff/tiffconf.h | 4 ++++ third_party/libtiff/tiffiop.h | 3 +-- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/third_party/libtiff/0000-build-config.patch b/third_party/libtiff/0000-build-config.patch index 50af2db529..8c773ab901 100644 --- a/third_party/libtiff/0000-build-config.patch +++ b/third_party/libtiff/0000-build-config.patch @@ -10,6 +10,16 @@ diff a/third_party/libtiff/tiffiop.h b/third_party/libtiff/tiffiop.h #ifdef HAVE_FCNTL_H # include +@@ -59,8 +59,7 @@ + + #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, ...); ++#define snprintf FXSYS_snprintf + #endif + + #include "tiffio.h" diff a/third_party/libtiff/tif_jpeg.c b/third_party/libtiff/tif_jpeg.c --- a/third_party/libtiff/tif_jpeg.c +++ b/third_party/libtiff/tif_jpeg.c @@ -82,7 +92,7 @@ diff a/third_party/libtiff/tif_zip.c b/third_party/libtiff/tif_zip.c diff a/third_party/libtiff/tiffconf.h b/third_party/libtiff/tiffconf.h --- /dev/null +++ b/third_party/libtiff/tiffconf.h -@@ -0,0 +1,252 @@ +@@ -0,0 +1,256 @@ +/* libtiff/tiffconf.h. Generated by configure. */ +/* + Configuration defines for installed libtiff. @@ -142,7 +152,11 @@ diff a/third_party/libtiff/tiffconf.h b/third_party/libtiff/tiffconf.h +#define SIZEOF_UNSIGNED_LONG 4 +#endif + ++#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ && _MSC_VER < 1900 ++#define HAVE_SNPRINTF 0 ++#else +#define HAVE_SNPRINTF 1 ++#endif + +/* Signed 8-bit type */ +#define TIFF_INT8_T signed char diff --git a/third_party/libtiff/tiffconf.h b/third_party/libtiff/tiffconf.h index fab7e0d27f..eb9161ded1 100644 --- a/third_party/libtiff/tiffconf.h +++ b/third_party/libtiff/tiffconf.h @@ -57,7 +57,11 @@ #define SIZEOF_UNSIGNED_LONG 4 #endif +#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ && _MSC_VER < 1900 +#define HAVE_SNPRINTF 0 +#else #define HAVE_SNPRINTF 1 +#endif /* Signed 8-bit type */ #define TIFF_INT8_T signed char diff --git a/third_party/libtiff/tiffiop.h b/third_party/libtiff/tiffiop.h index c647b8df3b..f4b2ea480a 100644 --- a/third_party/libtiff/tiffiop.h +++ b/third_party/libtiff/tiffiop.h @@ -59,8 +59,7 @@ extern void *lfind(const void *, const void *, size_t *, size_t, #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, ...); +#define snprintf FXSYS_snprintf #endif #include "tiffio.h" -- cgit v1.2.3