BetterC and Windows API calls

pineapple meapineapple at gmail.com
Fri Jun 2 19:19:57 UTC 2023


I've been experimenting a bit with betterC recently, and I've 
found that a trivial use of `QueryPerformanceFrequency` (the 
extern declaration imported from `core.sys.windows.winbase`) 
immediately crashes my program with status code 3221225477.

https://github.com/pineapplemachine/scamp.d/blob/master/src/scamp/time/monotonic.d#L76

What's going on here? The same code works as expected, without 
crashing, if I compile without -betterC.

Before this, I found that trying to use the 
`core.sys.windows.winbase` module's convenience overrides that 
accept a long pointer instead of a LARGE_INTEGER struct pointer 
would result in a linker error when compiling with -betterC.

Is there something I need to be doing differently to make Windows 
API calls, or is this a bug with betterC?



More information about the Digitalmars-d mailing list