link errors when using extern (C) structs

DanielG simpletangent at gmail.com
Sun Oct 28 04:23:27 UTC 2018


On Sunday, 28 October 2018 at 03:39:41 UTC, Nicholas Wilson wrote:
> write struct Foo {
>     double bar = 0.0; // The bitpattern of 0.0 is 0
> }

Thank you for your response.

Can you elaborate on 'write struct...'? Is that special syntax? I 
assumed so, but dmd doesn't like it. I also checked to see if you 
meant "(manually re-write it as...)", but updating the struct 
definition in the generated .d header with field values doesn't 
seem to solve the __initZ issue, either. And redefining it in the 
client .d module just shadows the header definition, so ...


More information about the Digitalmars-d-learn mailing list