commit:     5331483004ab6e2e16577d7d230b7d0b588325ed
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 10 18:19:27 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Dec 10 18:19:36 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=53314830

dev-libs/mpc: backport mpc.h fix

Fixes building e.g. GCC.

Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-libs/mpc/files/mpc-1.3.0-header.patch          | 31 ++++++++++++++++++++++
 .../mpc/{mpc-1.3.0.ebuild => mpc-1.3.0-r1.ebuild}  |  4 +++
 2 files changed, 35 insertions(+)

diff --git a/dev-libs/mpc/files/mpc-1.3.0-header.patch 
b/dev-libs/mpc/files/mpc-1.3.0-header.patch
new file mode 100644
index 000000000000..80f1d113f90c
--- /dev/null
+++ b/dev-libs/mpc/files/mpc-1.3.0-header.patch
@@ -0,0 +1,31 @@
+https://gitlab.inria.fr/mpc/mpc/-/commit/e944aa454e60cbff8ab4e8c70dd974083398378f
+https://sympa.inria.fr/sympa/arc/mpc-discuss/2022-12/msg00034.html
+
+From e944aa454e60cbff8ab4e8c70dd974083398378f Mon Sep 17 00:00:00 2001
+From: Paul Zimmermann <[email protected]>
+Date: Sat, 10 Dec 2022 08:47:51 +0100
+Subject: [PATCH] functions with FILE arguments should be defined only when
+ stdio.h is included
+
+--- a/src/mpc.h
++++ b/src/mpc.h
+@@ -270,6 +270,7 @@ __MPC_DECLSPEC long double _Complex mpc_get_ldc 
(mpc_srcptr, mpc_rnd_t);
+ __MPC_DECLSPEC int mpc_inp_str    (mpc_ptr, FILE *, size_t *, int, mpc_rnd_t);
+ __MPC_DECLSPEC size_t mpc_out_str (FILE *, int, size_t, mpc_srcptr, 
mpc_rnd_t);
+ __MPC_DECLSPEC void mpcb_out_str  (FILE *f, mpcb_srcptr);
++__MPC_DECLSPEC void mpcr_out_str (FILE *f, mpcr_srcptr r);
+ #endif
+ 
+ __MPC_DECLSPEC int mpcr_inf_p (mpcr_srcptr r);
+@@ -284,7 +285,6 @@ __MPC_DECLSPEC void mpcr_set_ui64_2si64 (mpcr_ptr r, 
uint64_t mant,
+    int64_t exp);
+ __MPC_DECLSPEC void mpcr_max (mpcr_ptr r, mpcr_srcptr s, mpcr_srcptr t);
+ __MPC_DECLSPEC int64_t mpcr_get_exp (mpcr_srcptr r);
+-__MPC_DECLSPEC void mpcr_out_str (FILE *f, mpcr_srcptr r);
+ __MPC_DECLSPEC void mpcr_mul (mpcr_ptr r, mpcr_srcptr s, mpcr_srcptr t);
+ __MPC_DECLSPEC void mpcr_mul_2ui (mpcr_ptr r, mpcr_srcptr s,
+    unsigned long int e);
+-- 
+GitLab
+
+

diff --git a/dev-libs/mpc/mpc-1.3.0.ebuild b/dev-libs/mpc/mpc-1.3.0-r1.ebuild
similarity index 95%
rename from dev-libs/mpc/mpc-1.3.0.ebuild
rename to dev-libs/mpc/mpc-1.3.0-r1.ebuild
index aa330fda2d8a..58311b7a2ead 100644
--- a/dev-libs/mpc/mpc-1.3.0.ebuild
+++ b/dev-libs/mpc/mpc-1.3.0-r1.ebuild
@@ -27,6 +27,10 @@ DEPEND="
 "
 RDEPEND="${DEPEND}"
 
+PATCHES=(
+       "${FILESDIR}"/${P}-header.patch
+)
+
 multilib_src_configure() {
        ECONF_SOURCE="${S}" econf $(use_enable static-libs static)
 }

Reply via email to