Fix udata type in wxFileSystemWatcher code under NetBSD 10
The previous fix in 5442edbbe9
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.
This commit is contained in:
committed by
Vadim Zeitlin
parent
29be54d76e
commit
a3212b35f6
@@ -23,6 +23,10 @@
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/event.h>
|
#include <sys/event.h>
|
||||||
|
|
||||||
|
#ifdef __NetBSD__
|
||||||
|
#include <sys/param.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "wx/dynarray.h"
|
#include "wx/dynarray.h"
|
||||||
#include "wx/evtloop.h"
|
#include "wx/evtloop.h"
|
||||||
#include "wx/evtloopsrc.h"
|
#include "wx/evtloopsrc.h"
|
||||||
@@ -32,9 +36,10 @@
|
|||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
|
|
||||||
// NetBSD is different as it uses intptr_t as type of kevent struct udata field
|
// NetBSD was different until version 10 (or almost), as it used intptr_t as
|
||||||
// for some reason, instead of "void*" as all the other platforms using kqueue.
|
// type of kevent struct udata field, instead of "void*" as all the other
|
||||||
#ifdef __NetBSD__
|
// 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<intptr_t>(d); }
|
inline intptr_t ToUdata(void* d) { return reinterpret_cast<intptr_t>(d); }
|
||||||
inline void* FromUdata(intptr_t d) { return reinterpret_cast<void*>(d); }
|
inline void* FromUdata(intptr_t d) { return reinterpret_cast<void*>(d); }
|
||||||
#else
|
#else
|
||||||
|
Reference in New Issue
Block a user