diff options
| author | Brent Cook <bcook@openbsd.org> | 2015-10-18 09:28:10 -0500 |
|---|---|---|
| committer | Brent Cook <bcook@openbsd.org> | 2015-10-18 09:28:10 -0500 |
| commit | 0197a589691274055e3a6f47a3652a6714d676bc (patch) | |
| tree | 9a2c16f2cb86605522ce747c1a71bfd0c23db389 /crypto | |
| parent | c8918dd0be1bbadfcebfc6631bd63f3b3e83befd (diff) | |
| download | portable-0197a589691274055e3a6f47a3652a6714d676bc.tar.gz portable-0197a589691274055e3a6f47a3652a6714d676bc.tar.bz2 portable-0197a589691274055e3a6f47a3652a6714d676bc.zip | |
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
Diffstat (limited to 'crypto')
| -rw-r--r-- | crypto/compat/timegm.c | 12 |
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 | ||
| 192 | struct 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 | |||
| 191 | time_t timegm(struct tm *tm) | 203 | time_t timegm(struct tm *tm) |
| 192 | { | 204 | { |
| 193 | struct tm new; | 205 | struct tm new; |
