commit:     ec1eebeb26c801965e3ca5d5d3b1b3757ed9b4be
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Wed Nov 13 11:07:42 2024 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Wed Nov 13 11:07:42 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ec1eebeb

x11-libs/agg: fix ICU compilation bug

Closes: https://bugs.gentoo.org/894708
Closes: https://bugs.gentoo.org/937853
Signed-off-by: David Seifert <soap <AT> gentoo.org>

 x11-libs/agg/agg-2.5-r3.ebuild                    |  4 +-
 x11-libs/agg/files/agg-2.5-char-ptr-cast.patch    | 13 +++++
 x11-libs/agg/files/agg-2.5-register-keyword.patch | 70 +++++++++++++++++++++++
 3 files changed, 86 insertions(+), 1 deletion(-)

diff --git a/x11-libs/agg/agg-2.5-r3.ebuild b/x11-libs/agg/agg-2.5-r3.ebuild
index 78e303ff492b..b4dbb7fd7b19 100644
--- a/x11-libs/agg/agg-2.5-r3.ebuild
+++ b/x11-libs/agg/agg-2.5-r3.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
@@ -34,6 +34,8 @@ PATCHES=(
        "${FILESDIR}"/${P}-sdl-automagic.patch
        "${FILESDIR}"/${P}-gcc8.patch
        "${FILESDIR}"/${PVR}
+       "${FILESDIR}"/${P}-char-ptr-cast.patch
+       "${FILESDIR}"/${P}-register-keyword.patch
 )
 
 src_prepare() {

diff --git a/x11-libs/agg/files/agg-2.5-char-ptr-cast.patch 
b/x11-libs/agg/files/agg-2.5-char-ptr-cast.patch
new file mode 100644
index 000000000000..043ebf056b22
--- /dev/null
+++ b/x11-libs/agg/files/agg-2.5-char-ptr-cast.patch
@@ -0,0 +1,13 @@
+https://bugs.gentoo.org/937853
+
+--- a/font_freetype/agg_font_freetype.cpp
++++ b/font_freetype/agg_font_freetype.cpp
+@@ -186,7 +186,7 @@
+             v_control = v_start;
+ 
+             point = outline.points + first;
+-            tags  = outline.tags  + first;
++            tags  = reinterpret_cast<char*>(outline.tags) + first;
+             tag   = FT_CURVE_TAG(tags[0]);
+ 
+             // A contour cannot start with a cubic control point!

diff --git a/x11-libs/agg/files/agg-2.5-register-keyword.patch 
b/x11-libs/agg/files/agg-2.5-register-keyword.patch
new file mode 100644
index 000000000000..b3e7cf138b78
--- /dev/null
+++ b/x11-libs/agg/files/agg-2.5-register-keyword.patch
@@ -0,0 +1,70 @@
+https://bugs.gentoo.org/894708
+
+--- a/include/agg_basics.h
++++ b/include/agg_basics.h
+@@ -212,7 +212,7 @@
+     {
+         AGG_INLINE static unsigned mul(unsigned a, unsigned b)
+         {
+-            register unsigned q = a * b + (1 << (Shift-1));
++            unsigned q = a * b + (1 << (Shift-1));
+             return (q + (q >> Shift)) >> Shift;
+         }
+     };
+--- a/include/agg_image_accessors.h
++++ b/include/agg_image_accessors.h
+@@ -183,8 +183,8 @@
+     private:
+         AGG_INLINE const int8u* pixel() const
+         {
+-            register int x = m_x;
+-            register int y = m_y;
++            int x = m_x;
++            int y = m_y;
+             if(x < 0) x = 0;
+             if(y < 0) y = 0;
+             if(x >= (int)m_pixf->width())  x = m_pixf->width() - 1;
+--- a/include/agg_trans_affine.h
++++ b/include/agg_trans_affine.h
+@@ -299,7 +299,7 @@
+     //------------------------------------------------------------------------
+     inline void trans_affine::transform(double* x, double* y) const
+     {
+-        register double tmp = *x;
++        double tmp = *x;
+         *x = tmp * sx  + *y * shx + tx;
+         *y = tmp * shy + *y * sy  + ty;
+     }
+@@ -307,7 +307,7 @@
+     //------------------------------------------------------------------------
+     inline void trans_affine::transform_2x2(double* x, double* y) const
+     {
+-        register double tmp = *x;
++        double tmp = *x;
+         *x = tmp * sx  + *y * shx;
+         *y = tmp * shy + *y * sy;
+     }
+@@ -315,9 +315,9 @@
+     //------------------------------------------------------------------------
+     inline void trans_affine::inverse_transform(double* x, double* y) const
+     {
+-        register double d = determinant_reciprocal();
+-        register double a = (*x - tx) * d;
+-        register double b = (*y - ty) * d;
++        double d = determinant_reciprocal();
++        double a = (*x - tx) * d;
++        double b = (*y - ty) * d;
+         *x = a * sy - b * shx;
+         *y = b * sx - a * shy;
+     }
+--- a/src/platform/win32/agg_platform_support.cpp
++++ b/src/platform/win32/agg_platform_support.cpp
+@@ -1303,7 +1303,7 @@
+         tok.len = 0;
+         if(m_src_string == 0 || m_start == -1) return tok;
+ 
+-        register const char *pstr = m_src_string + m_start;
++        const char *pstr = m_src_string + m_start;
+ 
+         if(*pstr == 0) 
+         {

Reply via email to