diff --git a/src/Platform.h b/src/Platform.h index 770a351..f2c4982 100644 --- a/src/Platform.h +++ b/src/Platform.h @@ -1,5 +1,11 @@ #pragma once +#ifdef _WIN32 +// Prevent bogus definitions of error codes +// that are incompatible with Winsock errors. +#define _CRT_NO_POSIX_ERROR_CODES +#endif + #include #include #include diff --git a/src/PlatformSockets.h b/src/PlatformSockets.h index 89feb41..5e5dffc 100644 --- a/src/PlatformSockets.h +++ b/src/PlatformSockets.h @@ -13,33 +13,10 @@ #define SHUT_RDWR SD_BOTH -// errno.h will include incompatible definitions of these -// values compared to what Winsock uses, so we must undef -// them to ensure the correct value is used. - -#ifdef EWOULDBLOCK -#undef EWOULDBLOCK -#endif #define EWOULDBLOCK WSAEWOULDBLOCK - -#ifdef EAGAIN -#undef EAGAIN -#endif #define EAGAIN WSAEWOULDBLOCK - -#ifdef EINPROGRESS -#undef EINPROGRESS -#endif #define EINPROGRESS WSAEINPROGRESS - -#ifdef EINTR -#undef EINTR -#endif #define EINTR WSAEINTR - -#ifdef ETIMEDOUT -#undef ETIMEDOUT -#endif #define ETIMEDOUT WSAETIMEDOUT typedef int SOCK_RET;