+
+#if defined __NetBSD__ && __NetBSD_Version__ <= 999001400
+ inline intptr_t udata_cast(EventHandler* eh)
+ {
+ // On NetBSD <10 the last parameter of EV_SET is intptr_t.
+ return reinterpret_cast<intptr_t>(eh);
+ }
+#else
+ inline void* udata_cast(EventHandler* eh)
+ {
+ // On other platforms the last parameter of EV_SET is void*.
+ return static_cast<void*>(eh);
+ }
+#endif