From 4ba000750e855b6c5a1445e35c0e1cef18e17675 Mon Sep 17 00:00:00 2001 From: mio Date: Sun, 15 Sep 2024 21:09:22 +1000 Subject: 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 (cherry picked from commit 5c1b76e6bf8e72bc04fe819b5e8bc2cd83241cf1) --- kimgio/tiffr.cpp | 13 ++++++++++--- 1 file 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 +#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)) -- cgit v1.2.1