]> git.ipfire.org Git - thirdparty/bind9.git/commit
Add C11 localtime_r and gmtime_r shims for Windows
authorOndřej Surý <ondrej@isc.org>
Fri, 13 Mar 2020 07:38:37 +0000 (08:38 +0100)
committerEvan Hunt <each@isc.org>
Tue, 17 Mar 2020 22:33:24 +0000 (15:33 -0700)
commitbfe832aea7c0ed2954acf0fb0a8db40b2d2066ef
tree613769441253e7621c5321bbb3ae958497cf6341
parent82edb5a54a1a8c053f2c1282c33c60d1481ee6e6
Add C11 localtime_r and gmtime_r shims for Windows

On Windows, C11 localtime_r() and gmtime_r() functions are not
available.  While localtime() and gmtime() functions are already thread
safe because they use Thread Local Storage, it's quite ugly to #ifdef
around every localtime_r() and gmtime_r() usage to make the usage also
thread-safe on POSIX platforms.

The commit adds wrappers around Windows localtime_s() and gmtime_s()
functions.

NOTE: The implementation of localtime_s and gmtime_s in Microsoft CRT
are incompatible with the C standard since it has reversed parameter
order and errno_t return type.

(cherry picked from commit 08f4c7d6c094c93ce7df093a8aa0890618959c83)
bin/dig/dig.c
bin/dnssec/dnssec-settime.c
bin/dnssec/dnssec-signzone.c
lib/dns/gen-win32.h
lib/dns/gen.c
lib/dns/update.c
lib/isc/win32/include/isc/time.h