diff options
| author | Alexander Barton <alex@barton.de> | 2012-09-04 23:28:32 +0200 |
|---|---|---|
| committer | Alexander Barton <alex@barton.de> | 2012-09-04 23:28:32 +0200 |
| commit | d2d867ea36b57c594546c5486aa8c2d4ef199af0 (patch) | |
| tree | 6a120a384526747b23ffd2ee3bb8ea695aeb578a /src | |
| parent | b232ae2f1727cfa8ae9106f0d65fc4cebe3a9d40 (diff) | |
| download | ngircd-d2d867ea36b57c594546c5486aa8c2d4ef199af0.tar.gz ngircd-d2d867ea36b57c594546c5486aa8c2d4ef199af0.zip | |
Define EV_SET() for kqueue() on systems that don't have it
Some systems, notably FreeBSD 4.x, do have the kqueue() function but lack the definition of EV_SET() in their header files -- but don't worry, we can #define it on our own ;-) Definition taken from /usr/include/sys/event.h of FreeBSD 8.1. Patch tested on FreeBSD 4.1 by Götz Hoffart. Thanks!
Diffstat (limited to 'src')
| -rw-r--r-- | src/ngircd/io.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/ngircd/io.c b/src/ngircd/io.c index 9ffdfd6b..cce6ef53 100644 --- a/src/ngircd/io.c +++ b/src/ngircd/io.c @@ -86,6 +86,20 @@ static int io_masterfd; static int io_dispatch_kqueue(struct timeval *tv); static bool io_event_change_kqueue(int, short, const int action); + +#ifndef EV_SET +/* Taken from /usr/include/sys/event.h of FreeBSD 8.1 and required by all + * platforms that have kqueue but lack EV_SET() -- for example FreeBSD 4. */ +#define EV_SET(kevp, a, b, c, d, e, f) do { \ + struct kevent *__kevp__ = (kevp); \ + __kevp__->ident = (a); \ + __kevp__->filter = (b); \ + __kevp__->flags = (c); \ + __kevp__->fflags = (d); \ + __kevp__->data = (e); \ + __kevp__->udata = (f); \ +} while(0) +#endif #endif #ifdef IO_USE_POLL |