Changeset View
Changeset View
Standalone View
Standalone View
src/compat.h
// Copyright (c) 2009-2010 Satoshi Nakamoto | // Copyright (c) 2009-2010 Satoshi Nakamoto | ||||
// Copyright (c) 2009-2016 The Bitcoin Core developers | // Copyright (c) 2009-2016 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#ifndef BITCOIN_COMPAT_H | #ifndef BITCOIN_COMPAT_H | ||||
#define BITCOIN_COMPAT_H | #define BITCOIN_COMPAT_H | ||||
#if defined(HAVE_CONFIG_H) | #if defined(HAVE_CONFIG_H) | ||||
#include "config/bitcoin-config.h" | #include <config/bitcoin-config.h> | ||||
#endif | #endif | ||||
#include <type_traits> | #include <type_traits> | ||||
// GCC 4.8 is missing some C++11 type_traits, | // GCC 4.8 is missing some C++11 type_traits, | ||||
// https://www.gnu.org/software/gcc/gcc-5/changes.html | // https://www.gnu.org/software/gcc/gcc-5/changes.html | ||||
#if defined(__GNUC__) && __GNUC__ < 5 | #if defined(__GNUC__) && __GNUC__ < 5 | ||||
#define IS_TRIVIALLY_CONSTRUCTIBLE std::is_trivial | #define IS_TRIVIALLY_CONSTRUCTIBLE std::is_trivial | ||||
Show All 35 Lines | |||||
#include <sys/select.h> | #include <sys/select.h> | ||||
#include <sys/socket.h> | #include <sys/socket.h> | ||||
#include <sys/types.h> | #include <sys/types.h> | ||||
#include <unistd.h> | #include <unistd.h> | ||||
#endif | #endif | ||||
#ifndef WIN32 | #ifndef WIN32 | ||||
typedef unsigned int SOCKET; | typedef unsigned int SOCKET; | ||||
#include "errno.h" | #include <errno.h> | ||||
#define WSAGetLastError() errno | #define WSAGetLastError() errno | ||||
#define WSAEINVAL EINVAL | #define WSAEINVAL EINVAL | ||||
#define WSAEALREADY EALREADY | #define WSAEALREADY EALREADY | ||||
#define WSAEWOULDBLOCK EWOULDBLOCK | #define WSAEWOULDBLOCK EWOULDBLOCK | ||||
#define WSAEMSGSIZE EMSGSIZE | #define WSAEMSGSIZE EMSGSIZE | ||||
#define WSAEINTR EINTR | #define WSAEINTR EINTR | ||||
#define WSAEINPROGRESS EINPROGRESS | #define WSAEINPROGRESS EINPROGRESS | ||||
#define WSAEADDRINUSE EADDRINUSE | #define WSAEADDRINUSE EADDRINUSE | ||||
Show All 33 Lines |