79.2.1
by Brian Aker
This add support for compiling libdrizzle for Windows via Mingw. |
1 |
/* LibMemcached
|
99.1.7
by Brian Aker
Update all copyright notices in .h and .cc files. |
2 |
* Copyright (C) 2012-2013 Drizzle Developer Group
|
79.2.1
by Brian Aker
This add support for compiling libdrizzle for Windows via Mingw. |
3 |
* Copyright (C) 2010 Brian Aker, Trond Norbye
|
4 |
* All rights reserved.
|
|
5 |
*
|
|
6 |
* Use and distribution licensed under the BSD license. See
|
|
7 |
* the COPYING file in the parent directory for full text.
|
|
8 |
*
|
|
9 |
* Summary: Implementation of poll by using select
|
|
10 |
*
|
|
11 |
*/
|
|
12 |
||
13 |
#pragma once
|
|
14 |
||
15 |
#if defined(WIN32) || defined(__MINGW32__)
|
|
16 |
||
17 |
#include <winsock2.h> |
|
18 |
||
19 |
#ifdef __cplusplus
|
|
20 |
extern "C" { |
|
21 |
#endif
|
|
22 |
||
23 |
typedef struct pollfd |
|
24 |
{
|
|
25 |
#ifdef WIN32
|
|
26 |
SOCKET fd; |
|
27 |
#else
|
|
28 |
int fd; |
|
29 |
#endif
|
|
30 |
short events; |
|
31 |
short revents; |
|
32 |
} pollfd_t; |
|
33 |
||
34 |
typedef int nfds_t; |
|
35 |
||
36 |
#define POLLIN 0x0001
|
|
37 |
#define POLLOUT 0x0004
|
|
38 |
#define POLLERR 0x0008
|
|
39 |
#define POLLHUP 0x010 /* Hung up. */ |
|
40 |
#define POLLNVAL 0x020 /* Invalid polling request. */ |
|
41 |
||
42 |
int poll(struct pollfd fds[], nfds_t nfds, int tmo); |
|
43 |
||
44 |
#ifdef __cplusplus
|
|
45 |
}
|
|
46 |
#endif
|
|
47 |
||
48 |
#endif // defined(WIN32) || defined(__MINGW32__) |