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:
parent
2a480ea83c
commit
eeeddf030d
1 changed files with 23 additions and 0 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue