6 #ifndef FABCOIN_COMPAT_H 7 #define FABCOIN_COMPAT_H 9 #if defined(HAVE_CONFIG_H) 17 #define _WIN32_WINNT 0x0501 18 #ifndef WIN32_LEAN_AND_MEAN 19 #define WIN32_LEAN_AND_MEAN 1 25 #undef FD_SETSIZE // prevent redefinition compiler warning 27 #define FD_SETSIZE 1024 // max number of fds in fd_set 35 #include <sys/fcntl.h> 37 #include <sys/select.h> 38 #include <sys/socket.h> 39 #include <sys/types.h> 41 #include <netinet/in.h> 42 #include <netinet/tcp.h> 43 #include <arpa/inet.h> 53 #define WSAGetLastError() errno 54 #define WSAEINVAL EINVAL 55 #define WSAEALREADY EALREADY 56 #define WSAEWOULDBLOCK EWOULDBLOCK 57 #define WSAEMSGSIZE EMSGSIZE 58 #define WSAEINTR EINTR 59 #define WSAEINPROGRESS EINPROGRESS 60 #define WSAEADDRINUSE EADDRINUSE 61 #define WSAENOTSOCK EBADF 62 #define INVALID_SOCKET (SOCKET)(~0) 63 #define SOCKET_ERROR -1 80 #define THREAD_PRIORITY_LOWEST PRIO_MAX 81 #define THREAD_PRIORITY_BELOW_NORMAL 2 82 #define THREAD_PRIORITY_NORMAL 0 83 #define THREAD_PRIORITY_ABOVE_NORMAL (-2) 87 #if HAVE_DECL_STRNLEN == 0 88 size_t strnlen(
const char *start,
size_t max_len);
89 #endif // HAVE_DECL_STRNLEN 91 bool static inline IsSelectableSocket(
const SOCKET& s) {
95 return (s < FD_SETSIZE);
99 #endif // FABCOIN_COMPAT_H
size_t strnlen(const char *start, size_t max_len)