Fixed autoconf macros for cross compile
[awesomized/libmemcached] / poll / poll.h
1 /* LibMemcached
2 * Copyright (C) 2010 Brian Aker, Trond Norbye
3 * All rights reserved.
4 *
5 * Use and distribution licensed under the BSD license. See
6 * the COPYING file in the parent directory for full text.
7 *
8 * Summary: Implementation of poll by using select
9 *
10 */
11 #ifndef POLL_POLL_H
12 #define POLL_POLL_H 1
13
14 #ifdef WIN32
15 #include <winsock2.h>
16 #endif
17
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21
22 typedef struct pollfd
23 {
24 #ifdef WIN32
25 SOCKET fd;
26 #else
27 int fd;
28 #endif
29 short events;
30 short revents;
31 } pollfd_t;
32
33 typedef int nfds_t;
34
35 #define POLLIN 0x0001
36 #define POLLOUT 0x0004
37 #define POLLERR 0x0008
38
39 int poll(struct pollfd fds[], nfds_t nfds, int tmo);
40
41 #ifdef __cplusplus
42 }
43 #endif
44
45 #endif