#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