6 #ifndef BITCOIN_COMPAT_H 7 #define BITCOIN_COMPAT_H 9 #if defined(HAVE_CONFIG_H) 18 #undef FD_SETSIZE // prevent redefinition compiler warning 20 #define FD_SETSIZE 1024 // max number of fds in fd_set 27 #include <sys/select.h> 28 #include <sys/socket.h> 29 #include <sys/types.h> 31 #include <netinet/in.h> 32 #include <netinet/tcp.h> 33 #include <arpa/inet.h> 43 #define WSAGetLastError() errno 44 #define WSAEINVAL EINVAL 45 #define WSAEALREADY EALREADY 46 #define WSAEWOULDBLOCK EWOULDBLOCK 47 #define WSAEAGAIN EAGAIN 48 #define WSAEMSGSIZE EMSGSIZE 49 #define WSAEINTR EINTR 50 #define WSAEINPROGRESS EINPROGRESS 51 #define WSAEADDRINUSE EADDRINUSE 52 #define WSAENOTSOCK EBADF 53 #define INVALID_SOCKET (SOCKET)(~0) 54 #define SOCKET_ERROR -1 58 #define WSAEAGAIN EAGAIN 60 #define WSAEAGAIN WSAEWOULDBLOCK 76 typedef int64_t ssize_t;
78 typedef int32_t ssize_t;
83 #if HAVE_DECL_STRNLEN == 0 84 size_t strnlen(
const char *start,
size_t max_len);
85 #endif // HAVE_DECL_STRNLEN 96 #if defined(__linux__) 101 #if defined(USE_POLL) || defined(WIN32) 104 return (s < FD_SETSIZE);
109 #if !defined(MSG_NOSIGNAL) 110 #define MSG_NOSIGNAL 0 114 #if !defined(MSG_DONTWAIT) 115 #define MSG_DONTWAIT 0 118 #endif // BITCOIN_COMPAT_H static bool IsSelectableSocket(const SOCKET &s)
size_t strnlen(const char *start, size_t max_len)