:pserver:anonymous@cvs.middle-man.sourceforge.net:/cvsroot/middle-man middleman
[middleman.git] / include / compat.h
1 #ifndef COMPAT_H
2 #define COMPAT_H
3
4 #ifndef HAVE_PTHREAD_RWLOCK_INIT
5 /* pthread rwlock's aren't very portable, these will replace them with a slower alternative */
6 #define pthread_rwlock_t pthread_mutex_t
7 #define pthread_rwlock_init pthread_mutex_init
8 #define pthread_rwlock_destroy pthread_mutex_destroy
9 #define pthread_rwlock_rdlock pthread_mutex_lock
10 #define pthread_rwlock_wrlock pthread_mutex_lock
11 #define pthread_rwlock_unlock pthread_mutex_unlock
12 #endif /* HAVE_PTHREAD_RWLOCK_INIT */
13
14 #ifndef HAVE_POLL
15
16 struct pollfd {
17         int fd;
18         short events;
19         short revents;
20 };
21
22 #define POLLIN         0x0001
23 #define POLLNORM       POLLIN
24 #define POLLPRI                POLLIN
25 #define POLLOUT                0x0008
26 #define POLLERR                0x0010
27 #define POLLHUP                0x0020
28 #define POLLNVAL       0x0040
29 #define POLLRDNORM     POLLIN
30 #define POLLRDBAND     POLLIN
31 #define POLLWRNORM     POLLOUT
32 #define POLLWRBAND     POLLOUT
33 #define POLLMSG                0x0800
34
35 #define __INVALIDPOLL  ~(POLLIN | POLLOUT)
36
37 #endif                          /* HAVE_POLL */
38
39 #endif                          /* COMPAT_H */