X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Fcompat.h;h=a4c648909ac3ac5033d960352ad62eae64cd91e2;hb=63e4509c569f16145ab861717baf865fc6d05af1;hp=d09ec4fea2a21d9f94ce41d975cf418bc55065f4;hpb=589ad785953e590eeea2fc2914eeb330fe1c6071;p=novacoin.git diff --git a/src/compat.h b/src/compat.h index d09ec4f..a4c6489 100644 --- a/src/compat.h +++ b/src/compat.h @@ -11,13 +11,23 @@ #ifndef NOMINMAX #define NOMINMAX #endif +#ifndef _MSC_VER +#ifdef FD_SETSIZE +#undef FD_SETSIZE +#endif +#define FD_SETSIZE 1024 // max number of fds in fd_set +#endif #include #include #include #else #include #include +#ifdef ANDROID +#include +#else #include +#endif #include #include #include @@ -27,7 +37,6 @@ typedef u_int SOCKET; #endif - #ifdef WIN32 #define MSG_NOSIGNAL 0 #define MSG_DONTWAIT 0 @@ -47,19 +56,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 +#endif \ No newline at end of file