Update CMakeLists.txt - play with openssl
[novacoin.git] / src / compat.h
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 COPYING or http://www.opensource.org/licenses/mit-license.php.
5 #ifndef _BITCOIN_COMPAT_H
6 #define _BITCOIN_COMPAT_H 1
7
8 #ifdef WIN32
9 #if (_WIN32_WINNT != _WIN_WINNT_WIN7)
10 #define _WIN32_WINNT 0x601
11 #endif
12 #define WIN32_LEAN_AND_MEAN 1
13 #ifndef NOMINMAX
14 #define NOMINMAX
15 #endif
16 #ifndef _MSC_VER
17 #ifdef FD_SETSIZE
18 #undef FD_SETSIZE
19 #endif
20 #define FD_SETSIZE 1024 // max number of fds in fd_set
21 #endif
22 #include <mswsock.h>
23 #include <ws2tcpip.h>
24 #else
25 #include <sys/types.h>
26 #include <sys/socket.h>
27 #ifdef ANDROID
28 #include <fcntl.h>
29 #else
30 #include <sys/fcntl.h>
31 #endif
32 #include <arpa/inet.h>
33 #include <netdb.h>
34 #include <net/if.h>
35 #include <netinet/in.h>
36 #include <ifaddrs.h>
37
38 typedef u_int SOCKET;
39 #endif
40
41 #ifdef WIN32
42 #define MSG_NOSIGNAL        0
43 #define MSG_DONTWAIT        0
44 typedef int socklen_t;
45 #else
46 #include "errno.h"
47 #define WSAGetLastError()   errno
48 #define WSAEINVAL           EINVAL
49 #define WSAEALREADY         EALREADY
50 #define WSAEWOULDBLOCK      EWOULDBLOCK
51 #define WSAEMSGSIZE         EMSGSIZE
52 #define WSAEINTR            EINTR
53 #define WSAEINPROGRESS      EINPROGRESS
54 #define WSAEADDRINUSE       EADDRINUSE
55 #define WSAENOTSOCK         EBADF
56 #define INVALID_SOCKET      (SOCKET)(~0)
57 #define SOCKET_ERROR        -1
58 #endif
59
60 #endif