On Wed, 5 Mar 2025, Pali Rohár wrote:

CRT DLL libraries older than msvcrt40 use internally in all time functions
dst bias of one hour. These DLL libraries do not export _dstbias variable
and neither __dstbias() and __p__dstbias() functions.

So for these CRT import libraries define import variable _dstbias with
fixed value -3600 (one hour) and include __dstbias() and __p__dstbias()
compatible functions (which returns pointer to _dstbias import variable).

With these definitions, it is possible to compile and link applications
which uses _dstbias (included from mingw-w64 time.h and defined as call to
__dstbias() function) with crtdll.dll, msvcrt10.dll or msvcrt20.dll. And
application via _dstbias will receive the dst bias which the CRT library is
currently using (like when linked with any other new CRT library).
---
mingw-w64-crt/Makefile.am     |  2 ++
mingw-w64-crt/misc/_dstbias.c | 11 +++++++++++
2 files changed, 13 insertions(+)
create mode 100644 mingw-w64-crt/misc/_dstbias.c

Ok, pushed.

// Martin

_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to