8000 posix: use WSAPoll on win32 · libgit2/libgit2@56eeb9f · GitHub
[go: up one dir, main page]

Skip to content

Commit 56eeb9f

Browse files 8000
committed
posix: use WSAPoll on win32
1 parent 1a44ace commit 56eeb9f

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

src/CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,12 @@ check_function_exists(getloadavg GIT_RAND_GETLOADAVG)
8989

9090
# poll
9191

92-
check_symbol_exists(poll poll.h GIT_IO_POLL)
93-
check_symbol_exists(select sys/select.h GIT_IO_SELECT)
92+
if(WIN32)
93+
set(GIT_IO_WSAPOLL 1)
94+
else()
95+
check_symbol_exists(poll poll.h GIT_IO_POLL)
96+
check_symbol_exists(select sys/select.h GIT_IO_SELECT)
97+
endif()
9498

9599
# determine architecture of the machine
96100

src/util/git2_features.h.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
#cmakedefine GIT_RAND_GETLOADAVG 1
6363

6464
#cmakedefine GIT_IO_POLL 1
65+
#cmakedefine GIT_IO_WSAPOLL 1
6566
#cmakedefine GIT_IO_SELECT 1
6667

6768
#endif

src/util/posix.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,9 @@ extern const char *p_gai_strerror(int ret);
198198
#ifdef GIT_IO_POLL
199199
# include <poll.h>
200200
# define p_poll poll
201+
#elif GIT_IO_WSAPOLL
202+
# include <winsock2.h>
203+
# define p_poll WSAPoll
201204
#else
202205
# define POLLIN 0x01
203206
# define POLLPRI 0x02

0 commit comments

Comments
 (0)
0