f7d3608b8269655bd7a10a81f13e7d0ca78f5e3c
[middleman.git] / include / compat.h
1 #ifndef COMPAT_H
2 #define COMPAT_H
3
4 #define pthread_mutex_t int
5 #define PTHREAD_MUTEX_INITIALIZER 0
6 #define pthread_attr_init(attr)
7 #define pthread_attr_destroy(attr)
8 #define pthread_attr_setdetachstate(attr,state)
9 #define pthread_attr_setschedpolicy(attr,policy)
10 #define pthread_mutex_init(mutex,attr)
11 #define pthread_mutex_lock(mutex)
12 #define pthread_mutex_unlock(mutex)
13 #define pthread_rwlock_init(lock,attr)
14 #define pthread_rwlock_destroy(lock)
15 #define pthread_rwlock_rdlock(lock)
16 #define pthread_rwlock_wrlock(lock)
17 #define pthread_rwlock_unlock(lock)
18 /* pthread_create(thread,attr,start_routine,arg) not ignorable */
19
20 #ifndef HAVE_POLL
21
22 struct pollfd {
23         int fd;
24         short events;
25         short revents;
26 };
27
28 #define POLLIN         0x0001
29 #define POLLNORM       POLLIN
30 #define POLLPRI                POLLIN
31 #define POLLOUT                0x0008
32 #define POLLERR                0x0010
33 #define POLLHUP                0x0020
34 #define POLLNVAL       0x0040
35 #define POLLRDNORM     POLLIN
36 #define POLLRDBAND     POLLIN
37 #define POLLWRNORM     POLLOUT
38 #define POLLWRBAND     POLLOUT
39 #define POLLMSG                0x0800
40
41 #define __INVALIDPOLL  ~(POLLIN | POLLOUT)
42
43 #endif                          /* HAVE_POLL */
44
45 #endif                          /* COMPAT_H */