1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

mingw add in missing poll defs

Based on work from Radu Sorici <soriciradu@gmail.com>

Signed-off-by: Andy Green <andy.green@linaro.org>
This commit is contained in:
Andy Green 2012-04-12 10:56:20 +08:00 committed by Andy Green
parent 2a480ea83c
commit eeeddf030d

View file

@ -19,6 +19,29 @@
#define random rand
#define usleep _sleep
#ifdef __MINGW64__
#define DEF_POLL_STUFF
#endif
#ifdef __MINGW32__
#define DEF_POLL_STUFF
#endif
#ifdef DEF_POLL_STUFF
typedef struct pollfd {
SOCKET fd;
short events;
short revents;
} WSAPOLLFD, *PWSAPOLLFD, *LPWSAPOLLFD;
#define POLLIN 0x0001 /* any readable data available */
#define POLLOUT 0x0004 /* file descriptor is writeable */
#define POLLERR 0x0008 /* some poll error occurred */
#define POLLHUP 0x0010 /* file descriptor was "hung up" */
#define POLLNVAL 0x0020 /* requested events "invalid" */
#endif
typedef INT (WSAAPI *PFNWSAPOLL)(LPWSAPOLLFD fdarray, ULONG nfds, INT timeout);
extern PFNWSAPOLL poll;