5 #ifndef _BITCOIN_COMPAT_H
6 #define _BITCOIN_COMPAT_H 1
9 #define _WIN32_WINNT 0x0501
10 #define WIN32_LEAN_AND_MEAN 1
14 #define FD_SETSIZE 1024 // max number of fds in fd_set
19 #include <sys/types.h>
20 #include <sys/socket.h>
21 #include <sys/fcntl.h>
22 #include <arpa/inet.h>
25 #include <netinet/in.h>
31 #define MSG_NOSIGNAL 0
32 #define MSG_DONTWAIT 0
33 typedef int socklen_t;
36 #define WSAGetLastError() errno
37 #define WSAEINVAL EINVAL
38 #define WSAEALREADY EALREADY
39 #define WSAEWOULDBLOCK EWOULDBLOCK
40 #define WSAEMSGSIZE EMSGSIZE
41 #define WSAEINTR EINTR
42 #define WSAEINPROGRESS EINPROGRESS
43 #define WSAEADDRINUSE EADDRINUSE
44 #define WSAENOTSOCK EBADF
45 #define INVALID_SOCKET (SOCKET)(~0)
46 #define SOCKET_ERROR -1
56 int ret = close(hSocket);
61 #define closesocket(s) myclosesocket(s)
int myclosesocket(SOCKET &hSocket)