how to declare C's static function?

aki via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Mar 27 21:27:27 PDT 2016


On Monday, 28 March 2016 at 04:12:56 UTC, Rikki Cattermole wrote:
> Do you need it to use extern(C)?
> Because if you don't, just drop that. D's mangling will fix it.

Yes, I do need extern(C) for some reason like:
alias Hook = extern(C) void function();
void sethook(Hook func) {
     ...
}
... sethook(&foo) ...

Some function expects such a function as an argument.

Aki.



More information about the Digitalmars-d-learn mailing list