aboutsummaryrefslogtreecommitdiff
path: root/crypto/compat/timegm.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/compat/timegm.c')
-rw-r--r--crypto/compat/timegm.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/crypto/compat/timegm.c b/crypto/compat/timegm.c
index 0655ce0..5a9e600 100644
--- a/crypto/compat/timegm.c
+++ b/crypto/compat/timegm.c
@@ -188,6 +188,18 @@ static int __secs_to_tm(long long t, struct tm *tm)
188 return 0; 188 return 0;
189} 189}
190 190
191#ifdef _WIN32
192struct tm *__gmtime_r(const time_t *t, struct tm *tm)
193{
194 if (__secs_to_tm(*t, tm) < 0) {
195 errno = EOVERFLOW;
196 return 0;
197 }
198 tm->tm_isdst = 0;
199 return tm;
200}
201#endif
202
191time_t timegm(struct tm *tm) 203time_t timegm(struct tm *tm)
192{ 204{
193 struct tm new; 205 struct tm new;