Skip to content

Commit aae3b56

Browse files
authored
fix memcpy (#196)
1 parent 4274cf1 commit aae3b56

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "TiffImages"
22
uuid = "731e570b-9d59-4bfa-96dc-6df516fadf69"
33
authors = ["Tamas Nagy <github@tamasnagy.com>"]
4-
version = "0.11.7"
4+
version = "0.11.8"
55

66
[deps]
77
ColorTypes = "3da002f7-5984-5a60-b8a6-cbb66c0b333f"

src/utils.jl

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,12 @@ else
147147
const _safe_open = open
148148
end
149149

150-
function memcpy(dest::Ptr{T}, src::Ptr{T}, n::Int) where T
151-
ccall(:memcpy, Ptr{T}, (Ptr{T}, Ptr{T}, Int), dest, src, n)
152-
end
150+
@static if isdefined(Base, :memcpy)
151+
function memcpy(dest::Ptr{T}, src::Ptr{T}, n::Int) where T
152+
Base.memcpy(dest, src, n)
153+
end
154+
else
155+
function memcpy(dest::Ptr{T}, src::Ptr{T}, n::Int) where T
156+
ccall(:memcpy, Ptr{T}, (Ptr{T}, Ptr{T}, Int), dest, src, n)
157+
end
158+
end

0 commit comments

Comments
 (0)