Skip to content

Commit

Permalink
Merge pull request #59 from JuliaString/spj/tests
Browse files Browse the repository at this point in the history
Update requirements, make work on v1.4 of Julia, improve tests
  • Loading branch information
ScottPJones authored Nov 8, 2020
2 parents 5d9f63a + ad56c70 commit 98d87c7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
test = ["Test", "Random", "Printf"]

[compat]
julia = "1.6"
julia = "1.4"
7 changes: 7 additions & 0 deletions src/printf.jl
Original file line number Diff line number Diff line change
Expand Up @@ -430,9 +430,16 @@ function _get_strspec(spec)
_strspec[spec] = string(spec; modifier="R")
end

@static if VERSION < v"1.5"
_snprintf(ptr, siz, spec, arg) =
ccall((:mpfr_snprintf,:libmpfr), Int32,
(Ptr{UInt8}, Culong, Ptr{UInt8}, Ref{BigFloat}...),
ptr, siz, spec, arg)
else
_snprintf(ptr, siz, spec, arg) =
@ccall "libmpfr".mpfr_snprintf(ptr::Ptr{UInt8}, siz::Csize_t, spec::Ptr{UInt8};
arg::Ref{BigFloat})::Cint
end

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

2 comments on commit 98d87c7

@ScottPJones
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator() register

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request updated: JuliaRegistries/General/24289

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v1.3.0 -m "<description of version>" 98d87c72c3217fcb463a3bce90f4dbf7646980e8
git push origin v1.3.0

Please sign in to comment.