[vlc-devel] [PATCH 2/2] win32: use WSAPoll when available
Steve Lhomme
robux4 at videolabs.io
Tue Oct 6 13:32:44 CEST 2015
---
compat/poll.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/compat/poll.c b/compat/poll.c
index fa94c93..080e885 100644
--- a/compat/poll.c
+++ b/compat/poll.c
@@ -108,9 +108,15 @@ int (poll) (struct pollfd *fds, unsigned nfds, int timeout)
#else
# include <windows.h>
# include <winsock2.h>
+# ifdef HAVE_IPHLPAPI_H
+# include <iphlpapi.h>
+# endif /* HAVE_IPHLPAPI_H */
int poll(struct pollfd *fds, unsigned nfds, int timeout)
{
+#if defined(HAVE_IPHLPAPI_H)
+ return WSAPoll(fds,nfds,timeout);
+#else
DWORD to = (timeout >= 0) ? (DWORD)timeout : INFINITE;
if (nfds == 0)
@@ -250,5 +256,6 @@ int poll(struct pollfd *fds, unsigned nfds, int timeout)
return -1;
}
return count;
+#endif /* HAVE_IPHLPAPI_H */
}
#endif
--
2.5.2
More information about the vlc-devel
mailing list