compat: document FD_SETSIZE redefinition for WIN32

This commit is contained in:
fanquake 2022-06-28 14:53:28 +01:00
parent cc7b2fdd70
commit 7c3df5e548
No known key found for this signature in database
GPG Key ID: 2EEB9F5CC09526C1

View File

@ -10,14 +10,17 @@
#include <config/bitcoin-config.h>
#endif
// Windows defines FD_SETSIZE to 64 (see _fd_types.h in mingw-w64),
// which is too small for our usage, but allows us to redefine it safely.
// We redefine it to be 1024, to match glibc, see typesizes.h.
#ifdef WIN32
#ifdef FD_SETSIZE
#undef FD_SETSIZE // prevent redefinition compiler warning
#undef FD_SETSIZE
#endif
#define FD_SETSIZE 1024 // max number of fds in fd_set
#define FD_SETSIZE 1024
#include <winsock2.h>
#include <ws2tcpip.h>
#include <stdint.h>
#include <cstdint>
#else
#include <fcntl.h>
#include <sys/mman.h>