tools/psl.c: Fix build on Windows

localtime_r() is not available on Windows but a more-secure variant
of localtime(), localtime_s() is provided on Windows.

Define localtime_r() on Windows as its arguments are reversed as compared
to localetime_s(), to achive more or less the same purpose.
This commit is contained in:
Chun-wei Fan 2022-12-27 12:57:04 +08:00 committed by Tim Rühsen
parent 86923341a3
commit c47cf796fc
1 changed files with 4 additions and 0 deletions

View File

@ -38,6 +38,10 @@
#ifdef _WIN32
# include <winsock2.h> // WSAStartup, WSACleanup
// Windows does not have localtime_r but has localtime_s, which is more or less
// the same except that the arguments are reversed
# define localtime_r(t_sec,t_now) localtime_s(t_now,t_sec)
#endif
#include <stdlib.h>