Skip to content

Commit 0937ba0

Browse files
committed
Revert "Add patch to MPFR version (#23287)"
This reverts commit 8f5f981. 1. The function is not unnecessary 2. The patch field of VersionNumber is not what this is meant for Note that the function name is `patches` not `patch` and it is > a null-terminated string containing the ids of the patches > applied to the MPFR library (contents of the PATCHES file), > separated by spaces As defined by the MPFR doc. In particular, it may not be a valid version string and must not be part of it.
1 parent c8dd3fd commit 0937ba0

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

base/mpfr.jl

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,8 @@ import Base.Math.lgamma_r
2727

2828
import Base.FastMath.sincos_fast
2929

30-
function version()
31-
version = unsafe_string(ccall((:mpfr_get_version,:libmpfr), Ptr{Cchar}, ()))
32-
build = replace(unsafe_string(ccall((:mpfr_get_patches,:libmpfr), Ptr{Cchar}, ())), ' ', '.')
33-
isempty(build) ? VersionNumber(version) : VersionNumber(version * '+' * build)
34-
end
30+
version() = VersionNumber(unsafe_string(ccall((:mpfr_get_version,:libmpfr), Ptr{Cchar}, ())))
31+
patches() = split(unsafe_string(ccall((:mpfr_get_patches,:libmpfr), Ptr{Cchar}, ())),' ')
3532

3633
function __init__()
3734
try

test/mpfr.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -865,7 +865,7 @@ end
865865
end
866866
end
867867
# issue #22758
868-
if MPFR.version() > v"3.1.5" || "r11590" in MPFR.version().build
868+
if MPFR.version() > v"3.1.5" || "r11590" in MPFR.patches()
869869
setprecision(2_000_000) do
870870
@test abs(sin(big(pi)/6) - 0.5) < ldexp(big(1.0),-1_999_000)
871871
end

0 commit comments

Comments
 (0)