From 0197a589691274055e3a6f47a3652a6714d676bc Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Sun, 18 Oct 2015 09:28:10 -0500 Subject: Windows compatibility fixes VS2013 has trouble with relative include paths for apps/openssl, so move certhash_win/apps_win.c back to apps/openssl. gmtime_r on mingw64 fails with negative time_t, override gmtime_s fails all of the time unit tests, override SHUT_RD/WR are defined in newer mingw64 headers, check before overriding --- crypto/compat/timegm.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'crypto') 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) return 0; } +#ifdef _WIN32 +struct tm *__gmtime_r(const time_t *t, struct tm *tm) +{ + if (__secs_to_tm(*t, tm) < 0) { + errno = EOVERFLOW; + return 0; + } + tm->tm_isdst = 0; + return tm; +} +#endif + time_t timegm(struct tm *tm) { struct tm new; -- cgit v1.2.3-55-g6feb