core.stdc and betterC

dd86k devddstuff at gmail.com
Mon Apr 30 21:51:13 UTC 2018


On Sunday, 29 April 2018 at 17:52:15 UTC, Adam D. Ruppe wrote:
> 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.

Windows isn't the only one affected. Under CRuntime_Glibc 
(usually for Linux), std* and all are defined just like in 
CRuntime_Microsoft, which still make them unusable in a 
-betterC(-only) context.

Or maybe I'm the only special guy who makes my projects betterC 
as a whole.

> 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.

Bless you! That was the last thing I needed to set for `_iob` 
(which in the Microsoft headers is set to _IOB_ENTRIES (20) and 
not _NFILE (512) (for FILE[*])), because I did cloned the Phobos 
repo and did modifications of my own, for my projects.


More information about the Digitalmars-d mailing list