File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 3737#include < unistd.h>
3838#endif
3939
40+ // We map Linux / BSD error functions and codes, to the equivalent
41+ // Windows definitions, and use the WSA* names throughout our code.
42+ // Note that glibc defines EWOULDBLOCK as EAGAIN (see errno.h).
4043#ifndef WIN32
4144typedef unsigned int SOCKET;
42- #include < errno.h >
45+ #include < cerrno >
4346#define WSAGetLastError () errno
4447#define WSAEINVAL EINVAL
4548#define WSAEWOULDBLOCK EWOULDBLOCK
@@ -51,14 +54,13 @@ typedef unsigned int SOCKET;
5154#define INVALID_SOCKET (SOCKET)(~0 )
5255#define SOCKET_ERROR -1
5356#else
54- # ifndef WSAEAGAIN
57+ // WSAEAGAIN doesn't exist on Windows
5558#ifdef EAGAIN
5659#define WSAEAGAIN EAGAIN
5760#else
5861#define WSAEAGAIN WSAEWOULDBLOCK
5962#endif
6063#endif
61- #endif
6264
6365// Windows doesn't define S_IRUSR or S_IWUSR. We define both
6466// here, with the same values as glibc (see stat.h).
You can’t perform that action at this time.
0 commit comments