Skip to content

Commit 8f5b64b

Browse files
authored
NetBSD 10 update, its kevent now aligns with other platforms (#4958)
regarding its udata field.
1 parent 6707938 commit 8f5b64b

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/os/signal.cc

+4-1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@
3131
#include <sys/event.h>
3232
#endif
3333
#endif
34+
#ifdef __NetBSD__
35+
#include <sys/param.h>
36+
#endif
3437

3538
using swoole::Event;
3639
using swoole::Reactor;
@@ -361,7 +364,7 @@ static SignalHandler swoole_signal_kqueue_set(int signo, SignalHandler handler)
361364
signals[signo].handler = handler;
362365
signals[signo].signo = signo;
363366
signals[signo].activated = true;
364-
#ifndef __NetBSD__
367+
#if !defined(__NetBSD__) || (defined(__NetBSD__) && __NetBSD_Version__ >= 1000000000)
365368
auto sigptr = &signals[signo];
366369
#else
367370
auto sigptr = reinterpret_cast<intptr_t>(&signals[signo]);

src/reactor/kqueue.cc

+6-3
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
#else
2727
#include <sys/event.h>
2828
#endif
29+
#ifdef __NetBSD__
30+
#include <sys/param.h>
31+
#endif
2932

3033
namespace swoole {
3134

@@ -99,7 +102,7 @@ int ReactorKqueue::add(Socket *socket, int events) {
99102
int fd = socket->fd;
100103
int fflags = 0;
101104

102-
#ifndef __NetBSD__
105+
#if !defined(__NetBSD__) || (defined(__NetBSD__) && __NetBSD_Version__ >= 1000000000)
103106
auto sobj = socket;
104107
#else
105108
auto sobj = reinterpret_cast<intptr_t>(socket);
@@ -141,7 +144,7 @@ int ReactorKqueue::set(Socket *socket, int events) {
141144
int fd = socket->fd;
142145
int fflags = 0;
143146

144-
#ifndef __NetBSD__
147+
#if !defined(__NetBSD__) || (defined(__NetBSD__) && __NetBSD_Version__ >= 1000000000)
145148
auto sobj = socket;
146149
#else
147150
auto sobj = reinterpret_cast<intptr_t>(socket);
@@ -193,7 +196,7 @@ int ReactorKqueue::del(Socket *socket) {
193196
int ret;
194197
int fd = socket->fd;
195198

196-
#ifndef __NetBSD__
199+
#if !defined(__NetBSD__) || (defined(__NetBSD__) && __NetBSD_Version__ >= 1000000000)
197200
auto sobj = socket;
198201
#else
199202
auto sobj = reinterpret_cast<intptr_t>(socket);

0 commit comments

Comments
 (0)