diff options
author | Tim Blechmann <tim.blechmann@qt.io> | 2025-08-12 17:06:06 +0800 |
---|---|---|
committer | Tim Blechmann <tim.blechmann@qt.io> | 2025-08-13 15:52:43 +0800 |
commit | 2bfc5d868416a2102711f794aacca51b1bcbafe8 (patch) | |
tree | 80cddd692afe6a6b37934b4684321db1b2fe8d48 | |
parent | d162e9d79590b9ef7f332440cc0685e4ca2d06a7 (diff) |
building with -DLOGLUV_PUBLIC=0 will convert some libtiff functions to
"static", preventing potential name clashes with downstream.
Pick-to: 6.10
Task-number: QTBUG-138543
Change-Id: I3808de27121ac975714b17508b20cb4bc5203e23
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
3 files changed, 35 insertions, 1 deletions
diff --git a/src/3rdparty/libtiff/libtiff/tiffio.h b/src/3rdparty/libtiff/libtiff/tiffio.h index 225f3c1..4a09388 100644 --- a/src/3rdparty/libtiff/libtiff/tiffio.h +++ b/src/3rdparty/libtiff/libtiff/tiffio.h @@ -590,7 +590,7 @@ extern int TIFFReadRGBAImageOriented(TIFF *, uint32_t, uint32_t, uint32_t *, extern uint64_t TIFFGetStrileByteCountWithErr(TIFF *tif, uint32_t strile, int *pbErr); -#ifdef LOGLUV_PUBLIC +#if LOGLUV_PUBLIC #define U_NEU 0.210526316 #define V_NEU 0.473684211 #define UVSCALE 410. diff --git a/src/3rdparty/libtiff/patches/0001-tiffio.h-fix-compilation-with-LOGLUV_PUBLIC-0.patch b/src/3rdparty/libtiff/patches/0001-tiffio.h-fix-compilation-with-LOGLUV_PUBLIC-0.patch new file mode 100644 index 0000000..b3d1297 --- /dev/null +++ b/src/3rdparty/libtiff/patches/0001-tiffio.h-fix-compilation-with-LOGLUV_PUBLIC-0.patch @@ -0,0 +1,32 @@ +From c7ea716f16a0eb018c791d05623ce7ae050c8064 Mon Sep 17 00:00:00 2001 +From: Tim Blechmann <tim@klingt.org> +Date: Tue, 12 Aug 2025 16:59:50 +0800 +Subject: [PATCH] tiffio.h: fix compilation with LOGLUV_PUBLIC=0 + +LOGLUV_PUBLIC can be used to compile some functions with hidden +visibility. +However this functionality was broken (in clang), as LOGLUV_PUBLIC was +defined to 1 if it wasn't defined, as the extern declarations were still +visible by the compiler leading to "static declaration follows +non-static declaration" errors. +Changing the header from #ifdef to #if fixes the issue. +--- + libtiff/tiffio.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libtiff/tiffio.h b/libtiff/tiffio.h +index 6a7ab2f5..f9c206e3 100644 +--- a/libtiff/tiffio.h ++++ b/libtiff/tiffio.h +@@ -608,7 +608,7 @@ extern int TIFFReadRGBAImageOriented(TIFF *, uint32_t, uint32_t, uint32_t *, + extern uint64_t TIFFGetStrileByteCountWithErr(TIFF *tif, uint32_t strile, + int *pbErr); + +-#ifdef LOGLUV_PUBLIC ++#if LOGLUV_PUBLIC + #define U_NEU 0.210526316 + #define V_NEU 0.473684211 + #define UVSCALE 410. +-- +2.50.1 + diff --git a/src/plugins/imageformats/tiff/CMakeLists.txt b/src/plugins/imageformats/tiff/CMakeLists.txt index 0fa69bf..902ae78 100644 --- a/src/plugins/imageformats/tiff/CMakeLists.txt +++ b/src/plugins/imageformats/tiff/CMakeLists.txt @@ -86,6 +86,8 @@ qt_internal_extend_target(QTiffPlugin CONDITION NOT QT_FEATURE_system_tiff ../../../3rdparty/libtiff/libtiff ATTRIBUTION_FILE_DIR_PATHS ../../../3rdparty/libtiff + DEFINES + LOGLUV_PUBLIC=0 ) qt_internal_extend_target(QTiffPlugin CONDITION WIN32 AND NOT QT_FEATURE_system_tiff |