-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
python3-gmpy2: patch and rebuild for mpfr-4.2.1
- Loading branch information
Showing
3 changed files
with
608 additions
and
1 deletion.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
srcpkgs/python3-gmpy2/patches/68a6b489c3d8d95b2658a1ed884fb99f4bd955c1.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
From 68a6b489c3d8d95b2658a1ed884fb99f4bd955c1 Mon Sep 17 00:00:00 2001 | ||
From: Sergey B Kirpichev <[email protected]> | ||
Date: Sun, 3 Sep 2023 02:35:19 +0300 | ||
Subject: [PATCH] Exclude MPFR workaround for MPFR >= 4.2.1 | ||
|
||
Co-authored-by: Vincent Lefevre <[email protected]> | ||
|
||
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 && |
Oops, something went wrong.