7 #ifndef _ANONCOIN_COMPAT_H
8 #define _ANONCOIN_COMPAT_H
14 #define _WIN32_WINNT 0x0501
15 #ifndef WIN32_LEAN_AND_MEAN
16 #define WIN32_LEAN_AND_MEAN 1
22 #undef FD_SETSIZE // prevent redefinition compiler warning
24 #define FD_SETSIZE 1024 // max number of fds in fd_set
32 #include <sys/fcntl.h>
34 #include <sys/socket.h>
35 #include <sys/types.h>
37 #include <netinet/in.h>
38 #include <arpa/inet.h>
46 #define MSG_DONTWAIT 0
50 #define WSAGetLastError() errno
51 #define WSAEINVAL EINVAL
52 #define WSAEALREADY EALREADY
53 #define WSAEWOULDBLOCK EWOULDBLOCK
54 #define WSAEMSGSIZE EMSGSIZE
55 #define WSAEINTR EINTR
56 #define WSAEINPROGRESS EINPROGRESS
57 #define WSAEADDRINUSE EADDRINUSE
58 #define WSAENOTSOCK EBADF
59 #define INVALID_SOCKET (SOCKET)(~0)
60 #define SOCKET_ERROR -1
70 int ret = close(hSocket);
75 #define closesocket(s) myclosesocket(s)
int myclosesocket(SOCKET &hSocket)