Just a quick question about ccall
and cconvert
. From the manual I know that
ccall((:foo, "libfoo"), Void, (A, ), x)
will result in a call to
ccall((:foo, "libfoo"), Void, (A, ), unsafe_convert(A, cconvert(A, x)))
But what about the following:
ccall((:foo, "libfoo"), Void, (Ptr{A}, ), x)
Will this result in a call to
ccall((:foo, "libfoo"), Void, (Ptr{A}, ), unsafe_convert(Ptr{A}, cconvert(A,x)))
or is there something else going on?
Here is how this came up. I have types A
and B
for which I define convert(Type{A}, ::B)
. Because of a typo I wrote
x::B
ccall((:foo, "libfoo"), Void, (Ptr{A}, ), x)
and it did not throw an error.