diff options
author | 2023-11-29 12:01:53 +0100 | |
---|---|---|
committer | 2023-11-29 12:03:34 +0100 | |
commit | 67e5e19196548136cbb1426e174656452396a4a2 (patch) | |
tree | a17582ca0cc028ccc3b61dd36cab73118aea476b /dev-python/gmpy/files | |
parent | dev-python/mkdocs-minify-plugin: restrict tests (diff) | |
download | gentoo-67e5e19196548136cbb1426e174656452396a4a2.tar.gz gentoo-67e5e19196548136cbb1426e174656452396a4a2.tar.bz2 gentoo-67e5e19196548136cbb1426e174656452396a4a2.zip |
dev-python/gmpy: Fix mpfr-4.2.1 compatibility
Closes: https://bugs.gentoo.org/916390
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python/gmpy/files')
-rw-r--r-- | dev-python/gmpy/files/gmpy-2.1.5-mpfr-4.2.1.patch | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/dev-python/gmpy/files/gmpy-2.1.5-mpfr-4.2.1.patch b/dev-python/gmpy/files/gmpy-2.1.5-mpfr-4.2.1.patch new file mode 100644 index 000000000000..4bbc9097824e --- /dev/null +++ b/dev-python/gmpy/files/gmpy-2.1.5-mpfr-4.2.1.patch @@ -0,0 +1,31 @@ +From 68a6b489c3d8d95b2658a1ed884fb99f4bd955c1 Mon Sep 17 00:00:00 2001 +From: Sergey B Kirpichev <skirpichev@gmail.com> +Date: Sun, 3 Sep 2023 02:35:19 +0300 +Subject: [PATCH] Exclude MPFR workaround for MPFR >= 4.2.1 + +Co-authored-by: Vincent Lefevre <vincent@vinc17.net> + +Closes #418 +--- + src/gmpy2_format.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/gmpy2_format.c b/src/gmpy2_format.c +index 3e450c96..303bb7bf 100644 +--- a/src/gmpy2_format.c ++++ b/src/gmpy2_format.c +@@ -592,12 +592,14 @@ GMPy_MPC_Format(PyObject *self, PyObject *args) + if (mpcstyle) + strcat(tempbuf, " "); + else { ++#if MPFR_VERSION < MPFR_VERSION_NUM(4,2,1) + /* Need to insert + if imag is nan or +inf. */ + if (mpfr_nan_p(mpc_imagref(MPC(self))) || + (mpfr_inf_p(mpc_imagref(MPC(self))) && + mpfr_sgn(mpc_imagref(MPC(self))) > 0)) { + strcat(tempbuf, "+"); + } ++#endif + } + strcat(tempbuf, imagbuf); + if (strlen(imagbuf) < 50 && |