Why is time_t defined as a 32-bit type on Windows?

Andrej Mitrovic andrej.mitrovich at gmail.com
Fri Aug 7 05:37:32 UTC 2020


On Wednesday, 5 August 2020 at 16:13:19 UTC, Andrej Mitrovic 
wrote:
> ```
> C:\dev> rdmd -m64 --eval="import core.stdc.time; 
> writeln(time_t.sizeof);"
> 4
> ```
>
> According to MSDN this should not be the case:
>
> https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/time-time32-time64?view=vs-2019
>
>> time is a wrapper for _time64 and **time_t is, by default, 
>> equivalent to __time64_t**.
>
> But in Druntime it's defined as a 32-bit type: 
> https://github.com/dlang/druntime/blob/349d63750d55d078426d4f433cba512625f8a3a3/src/core/sys/windows/stdc/time.d#L42

I filed it as an issue to get more eyes / feedback: 
https://issues.dlang.org/show_bug.cgi?id=21134


More information about the Digitalmars-d-learn mailing list