C's void func() vs. void func(void).

Mike Parker via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Jul 29 05:20:17 PDT 2016


On Friday, 29 July 2016 at 12:15:22 UTC, Mike Parker wrote:

>
> Yes, this is correct as long as the calling convention is not 
> stdcall or something else:

Though, I should add the caveat that you need to ensure the 
definition of the C function does not specify any parameters. 
AFAIK, this is legal:

// foo.h
void func();

// foo.c
void func(int a, int b) { ... }

In which case you would want to include the parameters in your 
binding.




More information about the Digitalmars-d-learn mailing list