X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Fcompat.h;h=4df4f4e7c0d7d6054cd186af4726322a176e1fe1;hb=HEAD;hp=804a8141b54401d5da8387f99cfa8ce323ac875d;hpb=5e9dc153609a849e1818763f9bc4187c90f34a71;p=novacoin.git diff --git a/src/compat.h b/src/compat.h index 804a814..4df4f4e 100644 --- a/src/compat.h +++ b/src/compat.h @@ -1,31 +1,43 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying -// file license.txt or http://www.opensource.org/licenses/mit-license.php. +// file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef _BITCOIN_COMPAT_H #define _BITCOIN_COMPAT_H 1 #ifdef WIN32 -#define _WIN32_WINNT 0x0501 +#if (_WIN32_WINNT != _WIN_WINNT_WIN7) +#define _WIN32_WINNT 0x601 +#endif #define WIN32_LEAN_AND_MEAN 1 #ifndef NOMINMAX #define NOMINMAX #endif -#include +#ifndef _MSC_VER +#ifdef FD_SETSIZE +#undef FD_SETSIZE +#endif +#define FD_SETSIZE 1024 // max number of fds in fd_set +#endif #include #include #else #include #include +#ifdef ANDROID +#include +#else #include +#endif #include #include #include #include #include -#endif typedef u_int SOCKET; +#endif + #ifdef WIN32 #define MSG_NOSIGNAL 0 #define MSG_DONTWAIT 0 @@ -45,19 +57,4 @@ typedef int socklen_t; #define SOCKET_ERROR -1 #endif -inline int myclosesocket(SOCKET& hSocket) -{ - if (hSocket == INVALID_SOCKET) - return WSAENOTSOCK; -#ifdef WIN32 - int ret = closesocket(hSocket); -#else - int ret = close(hSocket); -#endif - hSocket = INVALID_SOCKET; - return ret; -} -#define closesocket(s) myclosesocket(s) - - #endif