From a3212b35f6a92f75de64f58fb1ae01d254910055 Mon Sep 17 00:00:00 2001 From: Thomas Klausner Date: Wed, 16 Oct 2019 23:23:31 +0200 Subject: [PATCH] Fix udata type in wxFileSystemWatcher code under NetBSD 10 The previous fix in 5442edbbe90a27b4e08032423082e6ab2297eddd corrected the type for the older NetBSD versions, but not NetBSD 10, which now uses "void*", as all the other platforms, so restrict the original fix to NetBSD versions < 10 only. See #18199. --- src/unix/fswatcher_kqueue.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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