minimal closure usage

Anthony Green green@redhat.com
Tue Apr 30 07:19:00 GMT 2002


On Tue, 2002-04-30 at 02:37, Sam Liddicott wrote:
> Is there a simpler way to preserve all the old arguments but prepend or
> append the user_data as an additional one?  Or does the wrapped function
> have to have a calling signature of (ffi_cif*, void*, void**, void*)?

Not that I'm aware of.  One hack might be to simply shove the user_data
in some form of thread local data instead of passing it in as an arg.

> (BTW: Is there an array/structure/function/full-set-of-rules to convert
> between "int" and "ffi_type_sint" etc?  SWIG would need to refer to this as
> it generates the sample code below)

No, not really.  I think, however, that "int" always ==
"ffi_type_sint".  It's just the ffi_type_sint32, etc, which are platform
specific.

AG




More information about the Libffi-discuss mailing list