aboutsummaryrefslogtreecommitdiff
path: root/third_party/libtiff/0000-build-config.patch
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/libtiff/0000-build-config.patch')
-rw-r--r--third_party/libtiff/0000-build-config.patch118
1 files changed, 44 insertions, 74 deletions
diff --git a/third_party/libtiff/0000-build-config.patch b/third_party/libtiff/0000-build-config.patch
index 4acd37ec9..f66235abf 100644
--- a/third_party/libtiff/0000-build-config.patch
+++ b/third_party/libtiff/0000-build-config.patch
@@ -1,7 +1,7 @@
diff a/third_party/libtiff/tiffiop.h b/third_party/libtiff/tiffiop.h
--- a/third_party/libtiff/tiffiop.h
+++ b/third_party/libtiff/tiffiop.h
-@@ -30,7 +30,7 @@
+@@ -28,7 +28,7 @@
* ``Library-private'' definitions.
*/
@@ -10,47 +10,15 @@ diff a/third_party/libtiff/tiffiop.h b/third_party/libtiff/tiffiop.h
#ifdef HAVE_FCNTL_H
# include <fcntl.h>
-@@ -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
-@@ -85,8 +85,16 @@
- # define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */
+@@ -110,8 +110,16 @@
+ #define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */
#endif
--#include "jpeglib.h"
-#include "jerror.h"
-+#if defined(USE_SYSTEM_LIBJPEG)
-+#include <jerror.h>
-+#include <jpeglib.h>
-+#elif defined(USE_LIBJPEG_TURBO)
-+#include "third_party/libjpeg_turbo/jerror.h"
-+#include "third_party/libjpeg_turbo/jpeglib.h"
-+#else
-+#include "third_party/libjpeg/jerror.h"
-+#include "third_party/libjpeg/jpeglib.h"
-+#endif
-
- /*
- * Do we want to do special processing suitable for when JSAMPLE is a
-diff a/third_party/libtiff/tif_ojpeg.c b/third_party/libtiff/tif_ojpeg.c
---- a/third_party/libtiff/tif_ojpeg.c
-+++ b/third_party/libtiff/tif_ojpeg.c
-@@ -214,8 +214,17 @@
- # define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */
- #endif
-
-#include "jpeglib.h"
--#include "jerror.h"
+#if defined(USE_SYSTEM_LIBJPEG)
+#include <jerror.h>
+#include <jpeglib.h>
@@ -61,14 +29,13 @@ diff a/third_party/libtiff/tif_ojpeg.c b/third_party/libtiff/tif_ojpeg.c
+#include "third_party/libjpeg/jerror.h"
+#include "third_party/libjpeg/jpeglib.h"
+#endif
-+
- typedef struct jpeg_error_mgr jpeg_error_mgr;
- typedef struct jpeg_common_struct jpeg_common_struct;
+ /* Do optional compile-time version check */
+ #if defined(EXPECTED_JPEG_LIB_VERSION) && !defined(LIBJPEG_12_PATH)
diff a/third_party/libtiff/tiffconf.h b/third_party/libtiff/tiffconf.h
--- /dev/null
+++ b/third_party/libtiff/tiffconf.h
-@@ -0,0 +1,240 @@
+@@ -0,0 +1,244 @@
+/* libtiff/tiffconf.h. Generated by configure. */
+/*
+ Configuration defines for installed libtiff.
@@ -78,8 +45,11 @@ diff a/third_party/libtiff/tiffconf.h b/third_party/libtiff/tiffconf.h
+#ifndef _TIFFCONF_
+#define _TIFFCONF_
+
++#include <inttypes.h>
++#include <stddef.h>
++#include <stdint.h>
++
+#include "build/build_config.h"
-+#include "core/fxcrt/fx_system.h"
+
+//NOTE: The tiff codec requires an ANSI C compiler environment for building and
+// presumes an ANSI C environment for use.
@@ -97,27 +67,35 @@ diff a/third_party/libtiff/tiffconf.h b/third_party/libtiff/tiffconf.h
+#define HAVE_IEEEFP 1
+
+/* Define to 1 if you have the <string.h> header file. */
-+//#define HAVE_STRING_H 1
-+//fx_system.h already include the string.h in ANSIC
++#define HAVE_STRING_H 1
++
++/* Define to 1 if you have snprintf(). */
++#define HAVE_SNPRINTF 1
+
+/* Define to 1 if you have the <search.h> header file. */
-+#if defined(OS_WIN)
++#if BUILDFLAG(IS_WIN)
+// search.h is always available in VS 2015 and above, and may be
+// available in earlier versions.
+#define HAVE_SEARCH_H 1
+#endif
+
-+static const size_t sizeOfInt = sizeof(int);
-+/* The size of a `int', as computed by sizeof. */
-+#define SIZEOF_INT sizeOfInt
++/* The size of a `int'. */
++/* According typedef int int32_t; in the fx_system.h*/
++#define SIZEOF_INT 4
+
-+static const size_t sizeOfULong = sizeof(unsigned long);
++#if defined(ARCH_CPU_64_BITS)
+/* The size of `unsigned long', as computed by sizeof. */
-+#define SIZEOF_UNSIGNED_LONG sizeOfULong
++#define SIZEOF_UNSIGNED_LONG 8
++#else
++#define SIZEOF_UNSIGNED_LONG 4
++#endif
+
-+static const size_t sizeOfVoidP = sizeof(void*);
-+/* The size of void* as computed by sizeof. */
-+#define SIZEOF_VOIDP sizeOfVoidP
++/* The size of void*. */
++#ifdef __LP64__
++#define SIZEOF_VOIDP 8
++#else
++#define SIZEOF_VOIDP 4
++#endif
+
+/* Signed 8-bit type */
+#define TIFF_INT8_T signed char
@@ -159,7 +137,7 @@ diff a/third_party/libtiff/tiffconf.h b/third_party/libtiff/tiffconf.h
+
+#else // linux/unix
+
-+#if 0 //_FX_CPU_ == _FX_X64_ // linux/unix 64
++#if defined(ARCH_CPU_64_BITS)
+
+/* Signed 64-bit type formatter */
+#define TIFF_INT64_FORMAT "%ld"
@@ -170,6 +148,9 @@ diff a/third_party/libtiff/tiffconf.h b/third_party/libtiff/tiffconf.h
+/* Signed 64-bit type */
+#define TIFF_INT64_T signed long
+
++/* Unsigned 64-bit type */
++#define TIFF_UINT64_T unsigned long
++
+#else // linux/unix 32
+
+/* Signed 64-bit type formatter */
@@ -181,34 +162,23 @@ diff a/third_party/libtiff/tiffconf.h b/third_party/libtiff/tiffconf.h
+/* Signed 64-bit type */
+#define TIFF_INT64_T signed long long
+
-+#endif // end _FX_CPU_
-+
+/* Unsigned 64-bit type */
+#define TIFF_UINT64_T unsigned long long
+
-+#endif
-+
++#endif // define(ARCH_CPU_64_BITS)
+
-+/* Signed size type */
-+#ifdef _MSC_VER
-+
-+#if defined(_WIN64)
-+#define TIFF_SSIZE_T signed __int64
-+#else
-+#define TIFF_SSIZE_T signed int
+#endif
+
-+#else
-+
-+#define TIFF_SSIZE_T signed long
-+
-+#endif
+
-+/* Signed size type formatter */
-+#if defined(_WIN64)
-+#define TIFF_SSIZE_FORMAT "%I64d"
++/* Signed size type, type formatter, and size of size_t */
++#if defined(ARCH_CPU_64_BITS)
++#define TIFF_SSIZE_T int64_t
++#define TIFF_SSIZE_FORMAT PRId64
++#define SIZEOF_SIZE_T 8
+#else
-+#define TIFF_SSIZE_FORMAT "%ld"
++#define TIFF_SSIZE_T int32_t
++#define TIFF_SSIZE_FORMAT PRId32
++#define SIZEOF_SIZE_T 4
+#endif
+
+/* Pointer difference type */
@@ -264,7 +234,7 @@ diff a/third_party/libtiff/tiffconf.h b/third_party/libtiff/tiffconf.h
+
+/* Support Old JPEG compresson (read contrib/ojpeg/README first! Compilation
+ fails with unpatched IJG JPEG library) */
-+#define OJPEG_SUPPORT 1
++/* #undef OJPEG_SUPPORT */
+
+/* Support Macintosh PackBits algorithm */
+#define PACKBITS_SUPPORT 1
@@ -276,7 +246,7 @@ diff a/third_party/libtiff/tiffconf.h b/third_party/libtiff/tiffconf.h
+#define THUNDER_SUPPORT 1
+
+/* Support Deflate compression */
-+#define ZIP_SUPPORT 1
++/* #undef ZIP_SUPPORT */
+
+/* Support strip chopping (whether or not to convert single-strip uncompressed
+ images to mutiple strips of ~8Kb to reduce memory usage) */