Commit 9908c076 by Edward Thomson

posix: use WSAPoll on win32

parent 94f98400
...@@ -89,8 +89,12 @@ check_function_exists(getloadavg GIT_RAND_GETLOADAVG) ...@@ -89,8 +89,12 @@ check_function_exists(getloadavg GIT_RAND_GETLOADAVG)
# poll # poll
check_symbol_exists(poll poll.h GIT_IO_POLL) if(WIN32)
check_symbol_exists(select sys/select.h GIT_IO_SELECT) set(GIT_IO_WSAPOLL 1)
else()
check_symbol_exists(poll poll.h GIT_IO_POLL)
check_symbol_exists(select sys/select.h GIT_IO_SELECT)
endif()
# determine architecture of the machine # determine architecture of the machine
......
...@@ -62,6 +62,7 @@ ...@@ -62,6 +62,7 @@
#cmakedefine GIT_RAND_GETLOADAVG 1 #cmakedefine GIT_RAND_GETLOADAVG 1
#cmakedefine GIT_IO_POLL 1 #cmakedefine GIT_IO_POLL 1
#cmakedefine GIT_IO_WSAPOLL 1
#cmakedefine GIT_IO_SELECT 1 #cmakedefine GIT_IO_SELECT 1
#endif #endif
...@@ -198,6 +198,9 @@ extern const char *p_gai_strerror(int ret); ...@@ -198,6 +198,9 @@ extern const char *p_gai_strerror(int ret);
#ifdef GIT_IO_POLL #ifdef GIT_IO_POLL
# include <poll.h> # include <poll.h>
# define p_poll poll # define p_poll poll
#elif GIT_IO_WSAPOLL
# include <winsock2.h>
# define p_poll WSAPoll
#else #else
# define POLLIN 0x01 # define POLLIN 0x01
# define POLLPRI 0x02 # define POLLPRI 0x02
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment