diff options
-rw-r--r-- | src/CMakeLists.txt | 8 | ||||
-rw-r--r-- | src/util/git2_features.h.in | 1 | ||||
-rw-r--r-- | src/util/posix.h | 3 |
3 files changed, 10 insertions, 2 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a00ab600a..e9de94b52 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -89,8 +89,12 @@ check_function_exists(getloadavg GIT_RAND_GETLOADAVG) # poll -check_symbol_exists(poll poll.h GIT_IO_POLL) -check_symbol_exists(select sys/select.h GIT_IO_SELECT) +if(WIN32) + 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 diff --git a/src/util/git2_features.h.in b/src/util/git2_features.h.in index cf955122c..a84ea8956 100644 --- a/src/util/git2_features.h.in +++ b/src/util/git2_features.h.in @@ -62,6 +62,7 @@ #cmakedefine GIT_RAND_GETLOADAVG 1 #cmakedefine GIT_IO_POLL 1 +#cmakedefine GIT_IO_WSAPOLL 1 #cmakedefine GIT_IO_SELECT 1 #endif diff --git a/src/util/posix.h b/src/util/posix.h index f516bb3cc..74707453a 100644 --- a/src/util/posix.h +++ b/src/util/posix.h @@ -198,6 +198,9 @@ extern const char *p_gai_strerror(int ret); #ifdef GIT_IO_POLL # include <poll.h> # define p_poll poll +#elif GIT_IO_WSAPOLL +# include <winsock2.h> +# define p_poll WSAPoll #else # define POLLIN 0x01 # define POLLPRI 0x02 |