Undef error codes before redefining them for WSA

Fixes compiler warnings about redefined macros from errno.h.
pull/3/head
Tobias Junghans 6 years ago
parent 343eaabd7c
commit 09b2ed4381

@ -41,6 +41,9 @@
#ifdef WIN32
#undef SOCKET
#include <winsock2.h>
#ifdef EWOULDBLOCK
#undef EWOULDBLOCK
#endif
#define EWOULDBLOCK WSAEWOULDBLOCK
#define socklen_t int
#define close closesocket

@ -40,6 +40,9 @@
#ifdef WIN32
#undef SOCKET
#include <winsock2.h>
#ifdef EWOULDBLOCK
#undef EWOULDBLOCK
#endif
#define EWOULDBLOCK WSAEWOULDBLOCK
#define close closesocket
#define read(sock,buf,len) recv(sock,buf,len,0)

@ -109,7 +109,13 @@ int deny_severity=LOG_WARNING;
#pragma warning (disable: 4018 4761)
#endif
#define read(sock,buf,len) recv(sock,buf,len,0)
#ifdef EWOULDBLOCK
#undef EWOULDBLOCK
#endif
#define EWOULDBLOCK WSAEWOULDBLOCK
#ifdef ETIMEDOUT
#undef ETIMEDOUT
#endif
#define ETIMEDOUT WSAETIMEDOUT
#define write(sock,buf,len) send(sock,buf,len,0)
#else

Loading…
Cancel
Save