Re: [Vala] how to call extern function expecting function pointer?

Adam Dingle schrieb:
So: is there some attribute I can apply to the extern declaration that
will cause Vala to generate a compatible function prototype? Or should I
instead write some C code to wrap qsort() into a C function which Vala
can call more easily? Thanks for any advice -

You should declare your delegate static, since qsort doesn't allow you
to pass a closure pointer through to the compare function. The signature
of the delegate function type and the qsort function declaration
generated by Vala should then be compatible with the C library.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]