diff options
author | mio <stigma@disroot.org> | 2024-09-15 21:09:22 +1000 |
---|---|---|
committer | mio <stigma@disroot.org> | 2024-09-15 21:36:30 +1000 |
commit | 5c1b76e6bf8e72bc04fe819b5e8bc2cd83241cf1 (patch) | |
tree | a6f6e98bd581fdf03fd4788114c014dffbb04cd4 /kimgio | |
parent | 6adcd877982eeb335361e53da9392aa4bfdbd86c (diff) | |
download | tdelibs-5c1b76e6bf8e72bc04fe819b5e8bc2cd83241cf1.tar.gz tdelibs-5c1b76e6bf8e72bc04fe819b5e8bc2cd83241cf1.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 <stigma@disroot.org>
Diffstat (limited to 'kimgio')
-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)) |