Skip to content

Commit 8ff4114

Browse files
committed
Update version, make work on v1.4 of Julia
1 parent bc2ad3b commit 8ff4114

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ keywords = ["Strings", "Formatting"]
2323
license = "MIT"
2424
name = "Format"
2525
uuid = "1fa38f19-a742-5d3f-a2b9-30dd87b9d5f8"
26-
version = "1.2.1"
26+
version = "1.3.0"
2727

2828
[deps]
2929

@@ -36,4 +36,4 @@ Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
3636
test = ["Test", "Random", "Printf"]
3737

3838
[compat]
39-
julia = "1.6"
39+
julia = "1.4"

src/printf.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,9 +430,16 @@ function _get_strspec(spec)
430430
_strspec[spec] = string(spec; modifier="R")
431431
end
432432

433+
@static if VERSION < v"1.5"
434+
_snprintf(ptr, siz, spec, arg) =
435+
ccall((:mpfr_snprintf,:libmpfr), Int32,
436+
(Ptr{UInt8}, Culong, Ptr{UInt8}, Ref{BigFloat}...),
437+
ptr, siz, spec, arg)
438+
else
433439
_snprintf(ptr, siz, spec, arg) =
434440
@ccall "libmpfr".mpfr_snprintf(ptr::Ptr{UInt8}, siz::Csize_t, spec::Ptr{UInt8};
435441
arg::Ref{BigFloat})::Cint
442+
end
436443

437444
function _fmt(buf, pos, spec::FmtSpec{<:FmtFlts}, arg::BigFloat)
438445
isfinite(arg) || return _fmt(buf, pos, spec, Float64(arg))

0 commit comments

Comments
 (0)