commit:     785ecf0b5343348e298a5fad9c46ba58b9b303fe
Author:     Nicolas PARLANT <nicolas.parlant <AT> parhuet <DOT> fr>
AuthorDate: Tue Dec 16 10:10:44 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Dec 18 06:23:30 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=785ecf0b

x11-terms/rxvt-unicode: fix gcc16/c++20

rename lerp to avoid conflict with the non-identical function std::lerp

Closes: https://bugs.gentoo.org/967067
Signed-off-by: Nicolas PARLANT <nicolas.parlant <AT> parhuet.fr>
Part-of: https://github.com/gentoo/gentoo/pull/45045
Closes: https://github.com/gentoo/gentoo/pull/45045
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../files/rxvt-unicode-9.31-cxx20.patch            | 41 ++++++++++++++++++++++
 x11-terms/rxvt-unicode/rxvt-unicode-9.31-r4.ebuild |  1 +
 2 files changed, 42 insertions(+)

diff --git a/x11-terms/rxvt-unicode/files/rxvt-unicode-9.31-cxx20.patch 
b/x11-terms/rxvt-unicode/files/rxvt-unicode-9.31-cxx20.patch
new file mode 100644
index 000000000000..c9a224a7999c
--- /dev/null
+++ b/x11-terms/rxvt-unicode/files/rxvt-unicode-9.31-cxx20.patch
@@ -0,0 +1,41 @@
+see https://bugs.gentoo.org/967067
+lerp is declared globally with c++20 which is by default with gcc-16
+rename lerp to avoid conflict with the non-identical function std::lerp
+lerp is int here but std::lerp is float
+--- a/src/rxvttoolkit.C
++++ b/src/rxvttoolkit.C
+@@ -834,7 +834,7 @@ rxvt_color::set (rxvt_screen *screen, const char *name)
+   // parse the nonstandard "[alphapercent]" prefix
+   if (1 <= sscanf (name, "[%hd]%n", &c.a, &skip))
+     {
+-      c.a = lerp<int, int, int> (0, rgba::MAX_CC, c.a);
++      c.a = rxlerp<int, int, int> (0, rgba::MAX_CC, c.a);
+       name += skip;
+     }
+ 
+@@ -981,10 +981,10 @@ rxvt_color::fade (rxvt_screen *screen, int percent, 
rxvt_color &result, const rg
+   result.set (
+     screen,
+     rgba (
+-      lerp (c.r, to.r, percent),
+-      lerp (c.g, to.g, percent),
+-      lerp (c.b, to.b, percent),
+-      lerp (c.a, to.a, percent)
++      rxlerp (c.r, to.r, percent),
++      rxlerp (c.g, to.g, percent),
++      rxlerp (c.b, to.b, percent),
++      rxlerp (c.a, to.a, percent)
+     )
+   );
+ }
+--- a/src/rxvtutil.h
++++ b/src/rxvtutil.h
+@@ -21,7 +21,7 @@ template<typename T, typename U, typename V> static inline 
void clamp_it (T &v,
+ // linear interpolation
+ template<typename T, typename U, typename P>
+ static inline T
+-lerp (T a, U b, P p)
++rxlerp (T a, U b, P p)
+ {
+   return (long(a) * long(100 - p) + long(b) * long(p) + 50) / 100;
+ }

diff --git a/x11-terms/rxvt-unicode/rxvt-unicode-9.31-r4.ebuild 
b/x11-terms/rxvt-unicode/rxvt-unicode-9.31-r4.ebuild
index de9b0b478f51..52750c7cc3f4 100644
--- a/x11-terms/rxvt-unicode/rxvt-unicode-9.31-r4.ebuild
+++ b/x11-terms/rxvt-unicode/rxvt-unicode-9.31-r4.ebuild
@@ -48,6 +48,7 @@ PATCHES=(
        "${FILESDIR}"/${PN}-9.31-enable-wide-glyphs.patch
        "${FILESDIR}"/${PN}-9.31-perl5.38.patch
        "${FILESDIR}"/${PN}-9.31-osc-colour-command-termination.patch
+       "${FILESDIR}"/${PN}-9.31-cxx20.patch
 )
 DOCS=(
        Changes

Reply via email to