From 37a2adf420980e49094001a54abfdbbe3dffec29 Mon Sep 17 00:00:00 2001 From: John Lapeyre Date: Wed, 10 Jan 2024 13:59:00 -0500 Subject: [PATCH] Fix _memcmp call for Julia 1.10 This is not exported from Base and the way it is called has changed. --- src/FileCmp.jl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/FileCmp.jl b/src/FileCmp.jl index 6c5c830..d39296f 100644 --- a/src/FileCmp.jl +++ b/src/FileCmp.jl @@ -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)