This is the mail archive of the libffi-discuss@sourceware.org mailing list for the libffi project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFC: variadic closures in x86/x86_64


On 12/04/2013 06:28 PM, Hogan, D. (GE Power & Water) wrote:
> On Wed, Dec 04, 2013 at 00:07:21AM, Andrew Haley wrote:

> 
>> Why do you not define a variadic C function which does this:
>>
>> void f1(int n, ...) {
>>   va_list ap;
> 
> In the libffi manual, there's a TODO about variadic closures. 

That's AFAIK to do with targets that have a different calling convention
for variadic calls.

> My interpretation of variadic closures is a closure which can access
> variadic arguments without sending in the number of arguments and
> types at the ffi_prep_cif or ffi_prep_cif_var time.  Once you have a
> variadic closure, you should be call it any number of times with any
> number of variadic arguments.

Forgive me, but that's not an answer.  I have provided an example of a
mechanism that JNA could use that would not require us to change
libffi.  Couldn't you do this in JNA?  It doesn't have to be
application-specific.

Andrew.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]