diff --git a/src/unix/fswatcher_kqueue.cpp b/src/unix/fswatcher_kqueue.cpp index 0c5ffea93a..e7e7288894 100644 --- a/src/unix/fswatcher_kqueue.cpp +++ b/src/unix/fswatcher_kqueue.cpp @@ -23,6 +23,10 @@ #include #include +#ifdef __NetBSD__ + #include +#endif + #include "wx/dynarray.h" #include "wx/evtloop.h" #include "wx/evtloopsrc.h" @@ -32,9 +36,10 @@ namespace { -// NetBSD is different as it uses intptr_t as type of kevent struct udata field -// for some reason, instead of "void*" as all the other platforms using kqueue. -#ifdef __NetBSD__ +// NetBSD was different until version 10 (or almost), as it used intptr_t as +// type of kevent struct udata field, instead of "void*" as all the other +// platforms using kqueue, so accommodate it by adding an extra cast. +#if defined(__NetBSD__) && (__NetBSD_Version__ <= 999001400) inline intptr_t ToUdata(void* d) { return reinterpret_cast(d); } inline void* FromUdata(intptr_t d) { return reinterpret_cast(d); } #else