aboutsummaryrefslogtreecommitdiff
path: root/win32port/win32helpers/websock-w32.h
diff options
context:
space:
mode:
Diffstat (limited to 'win32port/win32helpers/websock-w32.h')
-rw-r--r--win32port/win32helpers/websock-w32.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/win32port/win32helpers/websock-w32.h b/win32port/win32helpers/websock-w32.h
index 5d64dfd8..2d2bb4ae 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;