diff options
author | Chris Liddell <chris.liddell@artifex.com> | 2022-05-12 14:23:24 +0100 |
---|---|---|
committer | Chris Liddell <chris.liddell@artifex.com> | 2022-05-12 14:23:24 +0100 |
commit | 7ef96d49195643da4a969ee63f15adf794f28eb7 (patch) | |
tree | ba04103f2ecf6a738ffdf5b7b317964b6d302225 /tiff | |
parent | dbdc191b257bc6e8cc6e3f4133eae543e397e5aa (diff) | |
download | ghostpdl-7ef96d49195643da4a969ee63f15adf794f28eb7.tar.gz |
Improve libtiff compatibility with older Visual Studios
Related to the C99 features libtiff is starting to use.
Diffstat (limited to 'tiff')
-rw-r--r-- | tiff/libtiff/tif_config.vc.h | 32 | ||||
-rw-r--r-- | tiff/libtiff/tif_fax3.c | 15 | ||||
-rw-r--r-- | tiff/libtiff/tif_fax3sm.c | 1 | ||||
-rw-r--r-- | tiff/libtiff/tiffconf.vc.h | 78 |
4 files changed, 88 insertions, 38 deletions
diff --git a/tiff/libtiff/tif_config.vc.h b/tiff/libtiff/tif_config.vc.h index 8a79991a9..5cebfa02e 100644 --- a/tiff/libtiff/tif_config.vc.h +++ b/tiff/libtiff/tif_config.vc.h @@ -127,38 +127,6 @@ #pragma warning(disable : 4996) /* function deprecation warnings */ -typedef char int8_t; -typedef unsigned char uint8_t; -typedef short int16_t; -typedef unsigned short uint16_t; -typedef int int32_t; -typedef unsigned int uint32_t; -typedef long long int64_t; -typedef unsigned long long uint64_t; - -#define UINT32_MAX 0xFFFFFFFF -#define UINT64_MAX 0xFFFFFFFFFFFFFFFF -#define INT64_MAX 0x7FFFFFFFFFFFFFFF - -#if _WIN64 -#define SIZE_MAX UINT64_MAX -#else -#define SIZE_MAX UINT32_MAX -#endif - -#define PRIu8 "u" -#define PRId8 "d" -#define PRIx8 "x" -#define PRIu16 "u" -#define PRId16 "d" -#define PRIx16 "x" -#define PRIu32 "u" -#define PRId32 "d" -#define PRIx32 "x" -#define PRIu64 "llu" -#define PRId64 "lld" -#define PRIx64 "llx" - #endif /* _TIF_CONFIG_H_ */ /* * Local Variables: diff --git a/tiff/libtiff/tif_fax3.c b/tiff/libtiff/tif_fax3.c index 0baf7ad3d..f68e83a2c 100644 --- a/tiff/libtiff/tif_fax3.c +++ b/tiff/libtiff/tif_fax3.c @@ -328,19 +328,24 @@ Fax3Decode2D(TIFF* tif, uint8_t* buf, tmsize_t occ, uint16_t s) #undef SWAP # define FILL(n, cp) \ - for (int32_t ifill = 0; ifill < (n); ++ifill) \ + { \ + int32_t ifill;\ + for (ifill = 0; ifill < (n); ++ifill) \ { \ (cp)[ifill] = 0xff; \ } \ - (cp) += (n); + (cp) += (n);\ + } # define ZERO(n, cp) \ - for (int32_t izero = 0; izero < (n); ++izero) \ + {\ + int32_t izero; \ + for (izero = 0; izero < (n); ++izero) \ { \ (cp)[izero] = 0; \ } \ - (cp) += (n); - + (cp) += (n);\ + } /* * Bit-fill a row according to the white/black * runs generated during G3/G4 decoding. diff --git a/tiff/libtiff/tif_fax3sm.c b/tiff/libtiff/tif_fax3sm.c index ba2fc532e..822191ecf 100644 --- a/tiff/libtiff/tif_fax3sm.c +++ b/tiff/libtiff/tif_fax3sm.c @@ -1,6 +1,5 @@ /* WARNING, this file was automatically generated by the mkg3states program */ -#include <stdint.h> #include "tiff.h" #include "tif_fax3.h" const TIFFFaxTabEnt TIFFFaxMainTable[128] = { diff --git a/tiff/libtiff/tiffconf.vc.h b/tiff/libtiff/tiffconf.vc.h index fb37a755f..94f637bf0 100644 --- a/tiff/libtiff/tiffconf.vc.h +++ b/tiff/libtiff/tiffconf.vc.h @@ -142,6 +142,84 @@ #define PHOTOSHOP_SUPPORT #define IPTC_SUPPORT + +typedef char int8_t; +typedef unsigned char uint8_t; +typedef short int16_t; +typedef unsigned short uint16_t; +typedef int int32_t; +typedef unsigned int uint32_t; +typedef long long int64_t; +typedef unsigned long long uint64_t; + +#ifndef UINT32_MAX +#define UINT32_MAX 0xFFFFFFFF +#endif + +#ifndef UINT64_MAX +#define UINT64_MAX 0xFFFFFFFFFFFFFFFF +#endif + +#ifndef INT64_MAX +#define INT64_MAX 0x7FFFFFFFFFFFFFFF +#endif + +#ifndef SIZE_MAX +#if _WIN64 +#define SIZE_MAX UINT64_MAX +#else +#define SIZE_MAX UINT32_MAX +#endif +#endif + +#ifndef PRIu8 +#define PRIu8 "u" +#endif + +#ifndef PRId8 +#define PRId8 "d" +#endif + +#ifndef PRIx8 +#define PRIx8 "x" +#endif + +#ifndef PRIu16 +#define PRIu16 "u" +#endif + +#ifndef PRId16 +#define PRId16 "d" +#endif + +#ifndef PRIx16 +#define PRIx16 "x" +#endif + +#ifndef PRIu32 +#define PRIu32 "u" +#endif + +#ifndef PRId32 +#define PRId32 "d" +#endif + +#ifndef PRIx32 +#define PRIx32 "x" +#endif + +#ifndef PRIu64 +#define PRIu64 "llu" +#endif + +#ifndef PRId64 +#define PRId64 "lld" +#endif + +#ifndef PRIx64 +#define PRIx64 "llx" +#endif + #endif /* _TIFFCONF_ */ /* * Local Variables: |