diff options
Diffstat (limited to 'tests/server/util.h')
-rw-r--r-- | tests/server/util.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/server/util.h b/tests/server/util.h index a56c5c445..2bcce5c4c 100644 --- a/tests/server/util.h +++ b/tests/server/util.h @@ -26,5 +26,39 @@ int ourerrno(void); void logmsg(const char *msg, ...); +#ifndef FALSE +#define FALSE 0 +#endif +#ifndef TRUE +#define TRUE 1 +#endif + +#if defined(WIN32) && !defined(__CYGWIN__) +#include <windows.h> +#include <winsock2.h> +#include <process.h> + +#define sleep(sec) Sleep ((sec)*1000) + +#define EINPROGRESS WSAEINPROGRESS +#define EWOULDBLOCK WSAEWOULDBLOCK +#define EISCONN WSAEISCONN +#define ENOTSOCK WSAENOTSOCK +#define ECONNREFUSED WSAECONNREFUSED + +static void win32_cleanup(void); +#if defined(ENABLE_IPV6) && defined(__MINGW32__) +const struct in6_addr in6addr_any = {{ IN6ADDR_ANY_INIT }}; #endif +#endif + +#endif + +#if defined(WIN32) && !defined(__CYGWIN__) +#undef perror +#define perror(m) win32_perror(m) +#endif + +void win32_init(void); +void win32_cleanup(void); |