diff options
Diffstat (limited to 'tests/server/util.c')
-rw-r--r-- | tests/server/util.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/tests/server/util.c b/tests/server/util.c index 8465cd9c..42e58534 100644 --- a/tests/server/util.c +++ b/tests/server/util.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -34,10 +34,13 @@ #ifdef HAVE_NETDB_H #include <netdb.h> #endif -#ifdef HAVE_SYS_POLL_H -#include <sys/poll.h> -#elif defined(HAVE_POLL_H) +#ifdef HAVE_POLL_H #include <poll.h> +#elif defined(HAVE_SYS_POLL_H) +#include <sys/poll.h> +#endif +#ifdef __MINGW32__ +#include <w32api.h> #endif #define ENABLE_CURLX_PRINTF @@ -55,9 +58,14 @@ #define EINVAL 22 /* errno.h value */ #endif +/* MinGW with w32api version < 3.6 declared in6addr_any as extern, + but lacked the definition */ #if defined(ENABLE_IPV6) && defined(__MINGW32__) +#if (__W32API_MAJOR_VERSION < 3) || \ + ((__W32API_MAJOR_VERSION == 3) && (__W32API_MINOR_VERSION < 6)) const struct in6_addr in6addr_any = {{ IN6ADDR_ANY_INIT }}; -#endif +#endif /* w32api < 3.6 */ +#endif /* ENABLE_IPV6 && __MINGW32__*/ /* This function returns a pointer to STATIC memory. It converts the given * binary lump to a hex formatted string usable for output in logs or @@ -92,7 +100,7 @@ void logmsg(const char *msg, ...) char buffer[2048 + 1]; FILE *logfp; int error; - struct timeval tv; + struct curltime tv; time_t sec; struct tm *now; char timebuf[20]; @@ -205,7 +213,7 @@ int wait_ms(int timeout_ms) #ifndef HAVE_POLL_FINE struct timeval pending_tv; #endif - struct timeval initial_tv; + struct curltime initial_tv; int pending_ms; int error; #endif |