Fix redefinition warning for errno.h constants on Windows
This commit is contained in:
parent
5f9f7ce407
commit
4b4162c1a1
1 changed files with 24 additions and 0 deletions
|
|
@ -12,10 +12,34 @@
|
||||||
#define LastSocketError() WSAGetLastError()
|
#define LastSocketError() WSAGetLastError()
|
||||||
|
|
||||||
#define SHUT_RDWR SD_BOTH
|
#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
|
#define EWOULDBLOCK WSAEWOULDBLOCK
|
||||||
|
|
||||||
|
#ifdef EAGAIN
|
||||||
|
#undef EAGAIN
|
||||||
|
#endif
|
||||||
#define EAGAIN WSAEWOULDBLOCK
|
#define EAGAIN WSAEWOULDBLOCK
|
||||||
|
|
||||||
|
#ifdef EINPROGRESS
|
||||||
|
#undef EINPROGRESS
|
||||||
|
#endif
|
||||||
#define EINPROGRESS WSAEINPROGRESS
|
#define EINPROGRESS WSAEINPROGRESS
|
||||||
|
|
||||||
|
#ifdef EINTR
|
||||||
|
#undef EINTR
|
||||||
|
#endif
|
||||||
#define EINTR WSAEINTR
|
#define EINTR WSAEINTR
|
||||||
|
|
||||||
|
#ifdef ETIMEDOUT
|
||||||
|
#undef ETIMEDOUT
|
||||||
|
#endif
|
||||||
#define ETIMEDOUT WSAETIMEDOUT
|
#define ETIMEDOUT WSAETIMEDOUT
|
||||||
|
|
||||||
typedef int SOCK_RET;
|
typedef int SOCK_RET;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue