Add option "-splash" so we can disable the splash screen.
[bitcoinplatinum.git] / src / compat.h
blob882610031a9692100129833fe348165900feb134
1 // Copyright (c) 2009-2010 Satoshi Nakamoto
2 // Copyright (c) 2009-2012 The Bitcoin developers
3 // Distributed under the MIT/X11 software license, see the accompanying
4 // file license.txt or http://www.opensource.org/licenses/mit-license.php.
5 #ifndef _BITCOIN_COMPAT_H
6 #define _BITCOIN_COMPAT_H 1
8 typedef u_int SOCKET;
9 #ifdef WIN32
10 #define MSG_NOSIGNAL 0
11 #define MSG_DONTWAIT 0
12 typedef int socklen_t;
13 #else
14 #include "errno.h"
15 #define WSAGetLastError() errno
16 #define WSAEINVAL EINVAL
17 #define WSAEALREADY EALREADY
18 #define WSAEWOULDBLOCK EWOULDBLOCK
19 #define WSAEMSGSIZE EMSGSIZE
20 #define WSAEINTR EINTR
21 #define WSAEINPROGRESS EINPROGRESS
22 #define WSAEADDRINUSE EADDRINUSE
23 #define WSAENOTSOCK EBADF
24 #define INVALID_SOCKET (SOCKET)(~0)
25 #define SOCKET_ERROR -1
26 #endif
28 inline int myclosesocket(SOCKET& hSocket)
30 if (hSocket == INVALID_SOCKET)
31 return WSAENOTSOCK;
32 #ifdef WIN32
33 int ret = closesocket(hSocket);
34 #else
35 int ret = close(hSocket);
36 #endif
37 hSocket = INVALID_SOCKET;
38 return ret;
40 #define closesocket(s) myclosesocket(s)
42 #endif