Commit Diff


commit - b232ae2f1727cfa8ae9106f0d65fc4cebe3a9d40
commit + d2d867ea36b57c594546c5486aa8c2d4ef199af0
blob - 9ffdfd6b8320e4ab12439e3273e92d99ceceb8a1
blob + cce6ef536557e7376bf93a1a8df9f912218ae0e4
--- src/ngircd/io.c
+++ 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