Skip to content

Commit

Permalink
Fix _memcmp call for Julia 1.10
Browse files Browse the repository at this point in the history
This is not exported from Base and the way it is called has
changed.
  • Loading branch information
jlapeyre committed Jan 10, 2024
1 parent 67878f8 commit 37a2adf
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/FileCmp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,12 @@ function filecmp(io1::IO, io2::IO, _bufsize::Integer=0; info=Val(false), limit::
if limit > 0
remaining -= n
end
# ret = _memcmp(buf1, buf2, n)
ret = Base._memcmp(buf1, buf2, n)
# ret = _memcmp(buf1, buf2, n)
if VERSION > v"1.10-"
ret = Base._memcmp(Base.unsafe_convert(Ptr{UInt8}, buf1), Base.unsafe_convert(Ptr{UInt8}, buf2), n)
else
ret = Base._memcmp(buf1, buf2, n)
end
if ret != 0
! _is_true(info) && return false
n_last = _where_memcmp(buf1, buf2, n)
Expand Down

0 comments on commit 37a2adf

Please sign in to comment.