Skip to content
This repository was archived by the owner on Dec 13, 2023. It is now read-only.

Commit b8e361e

Browse files
committed
win32: Win32 has no poll() so cannot provide termkey_waitkey()
1 parent 5bff94b commit b8e361e

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

man/termkey_waitkey.3.sh

+2
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ sed "s/\\\\/\\\\\\\\/g" demo.c
3838
cat <<EOF
3939
.in
4040
.fi
41+
.SH COMPATIBILITY
42+
This function is not available on Windows.
4143
.SH "SEE ALSO"
4244
.BR termkey_getkey (3),
4345
.BR termkey_set_waittime (3),

termkey.c

+6-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33

44
#include <ctype.h>
55
#include <errno.h>
6-
#include <poll.h>
7-
#include <unistd.h>
6+
#ifndef _WIN32
7+
# include <poll.h>
8+
# include <unistd.h>
9+
#endif
810
#include <string.h>
911
#include <strings.h>
1012

@@ -1055,6 +1057,7 @@ TermKeyResult termkey_getkey_force(TermKey *tk, TermKeyKey *key)
10551057
return ret;
10561058
}
10571059

1060+
#ifndef _WIN32
10581061
TermKeyResult termkey_waitkey(TermKey *tk, TermKeyKey *key)
10591062
{
10601063
if(tk->fd == -1) {
@@ -1114,6 +1117,7 @@ TermKeyResult termkey_waitkey(TermKey *tk, TermKeyKey *key)
11141117

11151118
/* UNREACHABLE */
11161119
}
1120+
#endif
11171121

11181122
TermKeyResult termkey_advisereadable(TermKey *tk)
11191123
{

0 commit comments

Comments
 (0)