Skip to content

Commit

Permalink
Change Ptr{Cvoid} to Any for pProgressData.
Browse files Browse the repository at this point in the history
  • Loading branch information
evetion authored and visr committed Jan 1, 2023
1 parent 040bda4 commit e80e95b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions gen/generator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,13 @@ function rewriter(x::Expr)
# lowercase the function name
f2 = Symbol(lowercase(String(f)))

# replace Ptr{Cvoid} with Any for callbacks, so Functions are converted by Julia
# The callback always follows the GDALProgressFunc type
i = findfirst(ex -> ex == :GDALProgressFunc, argtypes.args)
if !isnothing(i) && argtypes.args[i+1] == :(Ptr{Cvoid})
argtypes.args[i+1] = :(Any)
end

# bind the ccall such that we can easily wrap it
cc = :(ccall($fname, $rettype, $argtypes, $(argvalues...)))

Expand Down

0 comments on commit e80e95b

Please sign in to comment.