Int f() { return ...; }: What do I pass to ccall?

What do I pass when there are no arguments?

Uf, finally chanced on the right incantation:

function f()
        return ccall(dlsym(_LIB, :f),
        Cint,
        (),)
    end
1 Like

The new @ccall macro should make your life a bit easier:

f() = @ccall _LIB.f()::Cint
7 Likes