mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2025-12-21 09:07:26 -08:00
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@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@gentoo.org>
This commit is contained in:
parent
37f54cd718
commit
785ecf0b53
41
x11-terms/rxvt-unicode/files/rxvt-unicode-9.31-cxx20.patch
Normal file
41
x11-terms/rxvt-unicode/files/rxvt-unicode-9.31-cxx20.patch
Normal file
@ -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;
|
||||
}
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user