diff options
author | Glenn Strauss <gstrauss@gluelogic.com> | 2020-12-28 08:13:21 -0500 |
---|---|---|
committer | Glenn Strauss <gstrauss@gluelogic.com> | 2023-05-03 23:11:34 -0400 |
commit | db6b9f38228e88f7d45df1346198a78886919ee0 (patch) | |
tree | 0b2ae7038cc1a1c9c3ceb1b0b64853069eae1f4b /src/sys-time.h | |
parent | 407e8da4771875d01dbffa28ca5ba4ba14222650 (diff) | |
download | lighttpd-git-db6b9f38228e88f7d45df1346198a78886919ee0.tar.gz |
[core] _WIN32 use gmtime_s(), localtime_s()
Diffstat (limited to 'src/sys-time.h')
-rw-r--r-- | src/sys-time.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/sys-time.h b/src/sys-time.h index 0698cfbc..89edada5 100644 --- a/src/sys-time.h +++ b/src/sys-time.h @@ -22,11 +22,19 @@ * could turn these into subroutines which take a local mutex to protect the * calls to localtime() or gmtime()) */ #ifndef HAVE_LOCALTIME_R +#ifdef _WIN32 +#define localtime_r(timep,result) (localtime_s((result),(timep)), (result)) +#else #define localtime_r(timep,result) ((*(result) = *(localtime(timep))), (result)) #endif +#endif #ifndef HAVE_GMTIME_R +#ifdef _WIN32 +#define gmtime_r(timep,result) (gmtime_s((result),(timep)), (result)) +#else #define gmtime_r(timep,result) ((*(result) = *(gmtime(timep))), (result)) #endif +#endif #ifndef HAVE_TIMEGM #ifdef _WIN32 |