core.stdc and betterC

Adam D. Ruppe destructionator at gmail.com
Sun Apr 29 17:52:15 UTC 2018


On Sunday, 29 April 2018 at 15:52:11 UTC, dd86k wrote:
> It's all fine now. I'll type away my own bindings in a separate 
> source file (stdc.d).

You can also just do it in the usage module, for the individual 
functions you need. I do this a lot for various C libraries (and 
used to for the Win32 functions before they were included)

BTW i haven't tried win32 functions with betterC. we should - and 
they should generally work, though the struct inits might cause 
linker errors in some cases.

General tip btw: if you do see a linker error about "undefined 
symbol _Dsomething_init", you can probably just use `= void` when 
declaring the struct so it is not automatically initialized (so 
same behavior as C) and then memset it to 0 or whatever you need.


More information about the Digitalmars-d mailing list