6#ifndef BITCOIN_COMPAT_H
7#define BITCOIN_COMPAT_H
9#if defined(HAVE_CONFIG_H)
10#include <config/bitcoin-config.h>
20#define FD_SETSIZE 1024
29#include <netinet/in.h>
30#include <netinet/tcp.h>
33#include <sys/select.h>
34#include <sys/socket.h>
42#define WSAGetLastError() errno
43#define WSAEINVAL EINVAL
44#define WSAEALREADY EALREADY
45#define WSAEWOULDBLOCK EWOULDBLOCK
46#define WSAEAGAIN EAGAIN
47#define WSAEMSGSIZE EMSGSIZE
49#define WSAEINPROGRESS EINPROGRESS
50#define WSAEADDRINUSE EADDRINUSE
51#define WSAENOTSOCK EBADF
52#define INVALID_SOCKET (SOCKET)(~0)
53#define SOCKET_ERROR -1
57#define WSAEAGAIN EAGAIN
59#define WSAEAGAIN WSAEWOULDBLOCK
75typedef int64_t ssize_t;
77typedef int32_t ssize_t;
82#if HAVE_DECL_STRNLEN == 0
83size_t strnlen(
const char *start,
size_t max_len);
103#if defined(USE_POLL) || defined(WIN32)
106 return (s < FD_SETSIZE);
112#if !defined(MSG_NOSIGNAL)
113#define MSG_NOSIGNAL 0
118#if !defined(MSG_DONTWAIT)
119#define MSG_DONTWAIT 0
size_t strnlen(const char *start, size_t max_len)
static bool IsSelectableSocket(const SOCKET &s)