From 21be5359237fe7d4b844369ae62166e78b86ad15 Mon Sep 17 00:00:00 2001
From: Alexander Golubev <fatzer2@gmail.com>
Date: Sun, 17 May 2026 01:38:51 +0300
Subject: trinity-base/kcontrol: fix build with gcc-16/C++20

Closes: https://mirror.git.trinitydesktop.org/gitea/TDE/tde-packaging-gentoo/issues/509
Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
---
 ...6-joystick-Fix-build-issues-with-GCC-16.x.patch | 36 ++++++++++++++++++++++
 trinity-base/kcontrol/kcontrol-14.1.5.ebuild       |  4 +++
 trinity-base/kcontrol/kcontrol-14.1.6.ebuild       |  4 +++
 3 files changed, 44 insertions(+)
 create mode 100644 trinity-base/kcontrol/files/kcontrol-14.1.6-joystick-Fix-build-issues-with-GCC-16.x.patch

diff --git a/trinity-base/kcontrol/files/kcontrol-14.1.6-joystick-Fix-build-issues-with-GCC-16.x.patch b/trinity-base/kcontrol/files/kcontrol-14.1.6-joystick-Fix-build-issues-with-GCC-16.x.patch
new file mode 100644
index 00000000..5013cac5
--- /dev/null
+++ b/trinity-base/kcontrol/files/kcontrol-14.1.6-joystick-Fix-build-issues-with-GCC-16.x.patch
@@ -0,0 +1,36 @@
+From ed82f428f435f8216a608c3c76c0cceeb9339ad0 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= <slavek.banko@axis.cz>
+Date: Tue, 5 May 2026 00:11:54 +0200
+Subject: [PATCH] KControl - joystick: Fix build issues with GCC 16.x
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Remove now probably no longer needed __STRICT_ANSI__ to avoid
+redefinitions of structures originating from includes internal
+to "math.h" include.
+
+This resolves issue #735.
+
+Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
+---
+ kcontrol/joystick/joydevice.h | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/kcontrol/joystick/joydevice.h b/kcontrol/joystick/joydevice.h
+index 7519bbf67..de6d95ea4 100644
+--- a/kcontrol/joystick/joydevice.h
++++ b/kcontrol/joystick/joydevice.h
+@@ -24,9 +24,7 @@
+ #include <tqstring.h>
+ 
+ #include <sys/types.h>
+-#undef __STRICT_ANSI__
+ #include <linux/joystick.h>
+-#define __STRICT_ANSI__
+ 
+ // helper class which holds all current values, file descriptor, etc. for
+ // one device
+-- 
+2.53.0
+
diff --git a/trinity-base/kcontrol/kcontrol-14.1.5.ebuild b/trinity-base/kcontrol/kcontrol-14.1.5.ebuild
index 85530d9c..23021fd8 100644
--- a/trinity-base/kcontrol/kcontrol-14.1.5.ebuild
+++ b/trinity-base/kcontrol/kcontrol-14.1.5.ebuild
@@ -37,6 +37,10 @@ RDEPEND="${DEPEND}
 	~trinity-base/tdesu-${PV}
 "
 
+PATCHES=(
+	"$FILESDIR/${PN}-14.1.6-joystick-Fix-build-issues-with-GCC-16.x.patch"
+)
+
 src_configure() {
 	local mycmakeargs=(
 		-DWITH_XCURSOR=ON
diff --git a/trinity-base/kcontrol/kcontrol-14.1.6.ebuild b/trinity-base/kcontrol/kcontrol-14.1.6.ebuild
index 85530d9c..42efa6b6 100644
--- a/trinity-base/kcontrol/kcontrol-14.1.6.ebuild
+++ b/trinity-base/kcontrol/kcontrol-14.1.6.ebuild
@@ -37,6 +37,10 @@ RDEPEND="${DEPEND}
 	~trinity-base/tdesu-${PV}
 "
 
+PATCHES=(
+	"$FILESDIR/${P}-joystick-Fix-build-issues-with-GCC-16.x.patch"
+)
+
 src_configure() {
 	local mycmakeargs=(
 		-DWITH_XCURSOR=ON
-- 
cgit v1.2.3

