diff options
author | mio <[email protected]> | 2024-09-15 21:09:22 +1000 |
---|---|---|
committer | Slávek Banko <[email protected]> | 2024-09-15 19:58:45 +0200 |
commit | 4ba000750e855b6c5a1445e35c0e1cef18e17675 (patch) | |
tree | c1b067bf871cb3def712ca5129a4cbe569aaef84 | |
parent | e2732d386688e613c36aa16951b676349efa8d62 (diff) | |
download | tdelibs-4ba000750e855b6c5a1445e35c0e1cef18e17675.tar.gz tdelibs-4ba000750e855b6c5a1445e35c0e1cef18e17675.zip |
Fix FTBFS introduced by PR #302
LibTIFF versions 4.2.0 and older used custom integer types, causing
distributions with those versions to fail when building.
In 4.3.0 and newer, the 'uint16' and 'uint32' types are deprecated,
so this removes the deprecation warnings and keeps compatibility with
any versions of LibTIFF where uint16 and uint32 did not equal their
stdint.h counterparts.
Signed-off-by: mio <[email protected]>
(cherry picked from commit 5c1b76e6bf8e72bc04fe819b5e8bc2cd83241cf1)
-rw-r--r-- | kimgio/tiffr.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/kimgio/tiffr.cpp b/kimgio/tiffr.cpp index 79f890bfe..2678d537e 100644 --- a/kimgio/tiffr.cpp +++ b/kimgio/tiffr.cpp @@ -13,6 +13,13 @@ #include <assert.h> +#if (TIFFLIB_VERSION >= 20210416) +#undef uint16 +#define uint16 uint16_t +#undef uint32 +#define uint32 uint32_t +#endif + #include "tiffr.h" static tsize_t tiff_read( thandle_t handle, tdata_t buf, tsize_t size ) @@ -67,8 +74,8 @@ TDE_EXPORT void kimgio_tiff_read( TQImageIO *io ) uint32 width, height; uint32 *data; - uint16_t extra_samples_count; - uint16_t *extra_samples; + uint16 extra_samples_count; + uint16 *extra_samples; // FIXME: use qdatastream @@ -139,7 +146,7 @@ TDE_EXPORT void kimgio_tiff_read( TQImageIO *io ) if (TIFFGetField(tiff, TIFFTAG_EXTRASAMPLES, &extra_samples_count, &extra_samples) == 1) { kdDebug(399) << "TIFF image has " << extra_samples_count << " extra sample(s)." << endl; - for (uint16_t i = 0; i < extra_samples_count; i++) + for (uint16 i = 0; i < extra_samples_count; i++) { if ((extra_samples[i] == EXTRASAMPLE_ASSOCALPHA) || (extra_samples[i] == EXTRASAMPLE_UNASSALPHA)) |