From e63ac69ec6b7943adf691711907e3eefaf2e9517 Mon Sep 17 00:00:00 2001 From: Benjamin Sergeant Date: Sat, 13 Mar 2021 18:49:29 -0800 Subject: [PATCH] mock poll struct and macro for mingw --- ixwebsocket/IXNetSystem.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/ixwebsocket/IXNetSystem.h b/ixwebsocket/IXNetSystem.h index 5954d168..d4e2abac 100644 --- a/ixwebsocket/IXNetSystem.h +++ b/ixwebsocket/IXNetSystem.h @@ -16,6 +16,19 @@ // Define our own poll on Windows, as a wrapper on top of select typedef unsigned long int nfds_t; +// mingw does not know about poll so mock it +#if defined(__GNUC__) +struct pollfd { + int fd; /* file descriptor */ + short events; /* requested events */ + short revents; /* returned events */ +}; + +#define POLLIN 0x001 /* There is data to read. */ +#define POLLOUT 0x004 /* Writing now will not block. */ +#define POLLERR 0x008 /* Error condition. */ +#endif + #else #include #include