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 --- include/compat/time.h | 6 +++++- include/compat/win32netcompat.h | 11 ++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/compat/time.h b/include/compat/time.h index 9ed9c03..99a2001 100644 --- a/include/compat/time.h +++ b/include/compat/time.h @@ -9,11 +9,15 @@ #else #include <../include/time.h> #endif -#define gmtime_r(tp, tm) ((gmtime_s((tm), (tp)) == 0) ? (tm) : NULL) #else #include_next #endif +#ifdef _WIN32 +struct tm *__gmtime_r(const time_t * t, struct tm * tm); +#define gmtime_r(tp, tm) __gmtime_r(tp, tm) +#endif + #ifndef HAVE_TIMEGM time_t timegm(struct tm *tm); #endif diff --git a/include/compat/win32netcompat.h b/include/compat/win32netcompat.h index 452cfba..933f083 100644 --- a/include/compat/win32netcompat.h +++ b/include/compat/win32netcompat.h @@ -11,13 +11,18 @@ #ifdef _WIN32 #include +#include +#include +#ifndef SHUT_RDWR #define SHUT_RDWR SD_BOTH +#endif +#ifndef SHUT_RD #define SHUT_RD SD_RECEIVE +#endif +#ifndef SHUT_WR #define SHUT_WR SD_SEND - -#include -#include +#endif int posix_connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen); -- cgit v1.2.3-55-g6feb