Skip to content
This repository has been archived by the owner on Jan 14, 2022. It is now read-only.

invalid ccall/cfunction signature mismatch #3

Open
vtjnash opened this issue Dec 20, 2019 · 0 comments
Open

invalid ccall/cfunction signature mismatch #3

vtjnash opened this issue Dec 20, 2019 · 0 comments

Comments

@vtjnash
Copy link

vtjnash commented Dec 20, 2019

You're declaring @cfunction with type Ref{Minifier}, but calling it from ccall with type Ref{Minifier{IOBuffer}}. This is invalid: you must pass the same type in both places. One valid options would be to use Any in both places. Another valid option would be to use Ref{T} in both places (as is already being done in ccall) and allocating the specialized cfunction for the actual Context instance by defining as such:

function cb_map_start(ctx::T) where T <: Context
    return @cfunction on_map_start Cint (Ref{T},)
end
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant