diff -Nurd -x'*~' trickle-1.06.orig/Makefile.in trickle-1.06/Makefile.in --- trickle-1.06.orig/Makefile.in 2003-06-02 07:49:28.000000000 -0400 +++ trickle-1.06/Makefile.in 2007-04-04 22:49:11.000000000 -0400 @@ -105,7 +105,7 @@ tricklectl_SOURCES = tricklectl.c trickledu.c atomicio.c xdr.c tricklectl_LDADD = @ERRO@ @LIBOBJS@ -AM_CFLAGS = -Wall -Icompat @EVENTINC@ +AM_CPPFLAGS = -Wall -Icompat @EVENTINC@ overloaddir = $(libdir) overload_DATA = libtrickle.so diff -Nurd -x'*~' trickle-1.06.orig/trickle-overload.c trickle-1.06/trickle-overload.c --- trickle-1.06.orig/trickle-overload.c 2003-06-02 19:13:28.000000000 -0400 +++ trickle-1.06/trickle-overload.c 2007-04-04 22:48:58.000000000 -0400 @@ -35,7 +35,9 @@ #include #include #include -#include +#ifndef __APPLE__ +#include "poll.h" +#endif /* done below */ #include #include #if defined(HAVE_TIME_H) && defined(TIME_WITH_SYS_TIME) @@ -473,10 +475,37 @@ #define POLL_WRMASK (POLLOUT | POLLWRNORM | POLLWRBAND) #define POLL_RDMASK (POLLIN | /* POLLNORM | */ POLLPRI | POLLRDNORM | POLLRDBAND) +#if defined(__APPLE__) +/* Data structure describing a polling request, from fakepoll.h */ +struct pollfd + { + int fd; /* file desc to poll */ + short events; /* events of interest on fd */ + short revents; /* events that occurred on fd */ + }; + +//poll flags +#define POLLIN 0x0001 +#define POLLOUT 0x0004 +#define POLLERR 0x0008 + +// synonyms +#define POLLNORM POLLIN +#define POLLPRI POLLIN +#define POLLRDNORM POLLIN +#define POLLRDBAND POLLIN +#define POLLWRNORM POLLOUT +#define POLLWRBAND POLLOUT + +// ignored +#define POLLHUP 0x0010 +#define POLLNVAL 0x0020 +#endif /*__APPLE__*/ + #if defined(__linux__) || (defined(__svr4__) && defined(__sun__)) int poll(struct pollfd *fds, nfds_t nfds, int __timeout) -#elif defined(__FreeBSD__) +#elif defined(__FreeBSD__) || (defined(__APPLE)) int poll(struct pollfd *fds, unsigned int nfds, int __timeout) #else diff -urN trickle-1.06.ori/xdr.c trickle-1.06/xdr.c --- trickle-1.06.ori/xdr.c Mon Jun 2 01:07:01 2003 +++ trickle-1.06/xdr.c Wed Mar 3 20:26:39 2004 @@ -8,7 +8,9 @@ */ #include - +#ifdef __APPLE__ +#include +#endif #include "message.h" #define X(x) do { \