Windows: use select instead of WSAPoll, through a poll wrapper

This commit is contained in:
Benjamin Sergeant
2019-08-22 10:34:17 -07:00
parent 53c767140d
commit ff75846d2d
5 changed files with 84 additions and 10 deletions

View File

@ -13,22 +13,22 @@
#include <io.h>
#include <ws2def.h>
static inline int poll(struct pollfd *pfd, unsigned long nfds, int timeout)
{
return WSAPoll(pfd, nfds, timeout);
}
// Define our own poll on Windows
typedef unsigned long int nfds_t;
int poll(struct pollfd* fds, nfds_t nfds, int timeout);
#else
#include <arpa/inet.h>
#include <errno.h>
#include <netdb.h>
#include <netinet/tcp.h>
#include <poll.h>
#include <sys/select.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <unistd.h>
#include <poll.h>
#endif
namespace ix