summaryrefslogtreecommitdiffstats
path: root/include/libssh
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cynapses.org>2010-07-09 09:46:57 +0200
committerAndreas Schneider <asn@cynapses.org>2010-07-09 09:46:57 +0200
commit9791bc3eeb5c3099edc5650071134558c06e5eab (patch)
tree8e24445d3e2081a0821b6d5bdbc9caaa4e4cf8a6 /include/libssh
parent4ad78287979d383284de5355976fe820daec1e48 (diff)
downloadlibssh-9791bc3eeb5c3099edc5650071134558c06e5eab.tar.gz
libssh-9791bc3eeb5c3099edc5650071134558c06e5eab.tar.xz
libssh-9791bc3eeb5c3099edc5650071134558c06e5eab.zip
poll: Added poll constants for Windows.
WSAPoll uses different constanst values as the POSIX implementation, what else ...
Diffstat (limited to 'include/libssh')
-rw-r--r--include/libssh/poll.h42
1 files changed, 40 insertions, 2 deletions
diff --git a/include/libssh/poll.h b/include/libssh/poll.h
index d3a744f3..f54b614a 100644
--- a/include/libssh/poll.h
+++ b/include/libssh/poll.h
@@ -38,6 +38,45 @@ typedef struct ssh_pollfd_struct {
short revents; /* returned events */
} ssh_pollfd_t;
+typedef unsigned long int nfds_t;
+
+#ifdef _WIN32
+
+#ifndef POLLRDNORM
+#define POLLRDNORM 0x0100
+#endif
+#ifndef POLLRDBAND
+#define POLLRDBAND 0x0200
+#endif
+#ifndef POLLIN
+#define POLLIN (POLLRDNORM | POLLRDBAND)
+#endif
+#ifndef POLLPRI
+#define POLLPRI 0x0400
+#endif
+
+#ifndef POLLWRNORM
+#define POLLWRNORM 0x0010
+#endif
+#ifndef POLLOUT
+#define POLLOUT (POLLWRNORM)
+#endif
+#ifndef POLLWRBAND
+#define POLLWRBAND 0x0020
+#endif
+
+#ifndef POLLERR
+#define POLLERR 0x0001
+#endif
+#ifndef POLLHUP
+#define POLLHUP 0x0002
+#endif
+#ifndef POLLNVAL
+#define POLLNVAL 0x0004
+#endif
+
+#else /* _WIN32 */
+
/* poll.c */
#ifndef POLLIN
#define POLLIN 0x001 /* There is data to read. */
@@ -72,8 +111,7 @@ typedef struct ssh_pollfd_struct {
#define POLLWRBAND 0x200 /* mapped to write fds_set */
#endif
-
-typedef unsigned long int nfds_t;
+#endif /* WIN32 */
#endif /* HAVE_POLL */
void ssh_poll_init(void);