Commit 6d549aec authored by nia's avatar nia Committed by Daniel Black

threadpool_generic: support future NetBSD kqueue versions

In NetBSD 9.x and prior, udata is an intptr_t, but in 10.x (current
development branch) it was changed to be a void * for compatibility
with other BSDs a year or so ago.

Unfortunately, this does not simplify the code, as NetBSD 8.x and 9.x
are still supported and will be for a few more years.
Signed-off-by: default avatarNia Alarie <nia@NetBSD.org>
parent 2eb35749
......@@ -234,14 +234,19 @@ static void *native_event_get_userdata(native_event *event)
#elif defined(HAVE_KQUEUE)
/*
NetBSD is incompatible with other BSDs , last parameter in EV_SET macro
(udata, user data) needs to be intptr_t, whereas it needs to be void*
everywhere else.
NetBSD prior to 9.99.17 is incompatible with other BSDs, last parameter
in EV_SET macro (udata, user data) needs to be intptr_t, whereas it needs
to be void* everywhere else.
*/
#ifdef __NetBSD__
#include <sys/param.h>
# if !__NetBSD_Prereq__(9,99,17)
#define MY_EV_SET(a, b, c, d, e, f, g) EV_SET(a, b, c, d, e, f, (intptr_t)g)
#else
# endif
#endif
#ifndef MY_EV_SET
#define MY_EV_SET(a, b, c, d, e, f, g) EV_SET(a, b, c, d, e, f, g)
#endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment