mingw add in missing poll defs
authorAndy Green <andy@warmcat.com>
Thu, 12 Apr 2012 02:56:20 +0000 (10:56 +0800)
committerAndy Green <andy.green@linaro.org>
Thu, 12 Apr 2012 05:30:55 +0000 (13:30 +0800)
Based on work from Radu Sorici <soriciradu@gmail.com>

Signed-off-by: Andy Green <andy.green@linaro.org>
win32port/win32helpers/websock-w32.h

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