BetterC and Windows API calls

Dave P. dave287091 at gmail.com
Sat Jun 3 16:39:54 UTC 2023


On Saturday, 3 June 2023 at 08:13:30 UTC, pineapple wrote:
> On Friday, 2 June 2023 at 21:23:46 UTC, Steven Schveighoffer 
> wrote:
>> That error code is 0xC0000005, which is an access violation 
>> (segfault). Basically, a memory read/write error.
>>
>> Using static in D means TLS. I'm not sure what the rules are 
>> for TLS and betterC, but perhaps it's not properly set up?
>>
>> Maybe try __gshared instead of static? Not sure.
>>
>> -Steve
>
> Ahh, I had not even got around to considering that accessing 
> the `static` declaration could be the problem. That seems like 
> a bug?
>
> Anyway, declaring it as either `static shared` or `static 
> __gshared` fixes the crash - thanks for pointing me to that!

Still file an issue though, TLS should either work or fail to 
compile, not crash at runtime.



More information about the Digitalmars-d mailing list