diff options
author | Andy Green <andy@warmcat.com> | 2012-04-12 10:56:20 +0800 |
---|---|---|
committer | Andy Green <andy.green@linaro.org> | 2012-04-12 13:30:55 +0800 |
commit | eeeddf030dcd62853de8d2bd56ddf55f49f14f33 (patch) | |
tree | a85032e09589c78e1b84b0d86407196f707a77a0 | |
parent | 2a480ea83c19a5b1b064daba559759c23c88ce95 (diff) |
mingw add in missing poll defs
Based on work from Radu Sorici <soriciradu@gmail.com>
Signed-off-by: Andy Green <andy.green@linaro.org>
-rw-r--r-- | win32port/win32helpers/websock-w32.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/win32port/win32helpers/websock-w32.h b/win32port/win32helpers/websock-w32.h index 5d64dfd..2d2bb4a 100644 --- a/win32port/win32helpers/websock-w32.h +++ b/win32port/win32helpers/websock-w32.h @@ -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;
|