Wrapping C code?

bearophile bearophileHUGS at lycos.com
Sat Mar 29 12:42:33 PDT 2014


CJS:

> When you say define them in bulk at compile time, is there some 
> convenient way to just give an array of actions and iterate 
> over them to generate such statements? So that the only work 
> that needs to be updated to add/remove actions is updating that 
> list?

You also need extern(C). So the code gets more complex, sorry. 
You need a list of the C functions with their signatures, and 
then you can import this list at compile time and generate the D 
names, and mix them in a module with mixin(code).

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list