changeset 9433:0afc152028f0

Configure: set NGX_KQUEUE_UDATA_T at compile time. The NGX_KQUEUE_UDATA_T macro is used to compensate the incompatible kqueue() API in NetBSD, it doesn't really belong to feature tests. The change limits the macro visibility to the kqueue event module. Moving from autotests also simplifies testing a particular NetBSD version as seen in a subsequent change.
author Sergey Kandaurov <pluknet@nginx.com>
date Thu, 10 Jul 2025 16:30:35 +0400
parents b7dd813a5a6f
children 13426789d655
files auto/unix src/event/modules/ngx_kqueue_module.c
diffstat 2 files changed, 9 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/auto/unix	Tue Jul 08 22:45:33 2025 +0400
+++ b/auto/unix	Thu Jul 10 16:30:35 2025 +0400
@@ -129,26 +129,6 @@
 fi
 
 
-if [ "$NGX_SYSTEM" = "NetBSD" ]; then
-
-    # NetBSD 2.0 incompatibly defines kevent.udata as "intptr_t"
-
-    cat << END >> $NGX_AUTO_CONFIG_H
-
-#define NGX_KQUEUE_UDATA_T
-
-END
-
-else
-    cat << END >> $NGX_AUTO_CONFIG_H
-
-#define NGX_KQUEUE_UDATA_T  (void *)
-
-END
-
-fi
-
-
 ngx_feature="crypt()"
 ngx_feature_name="NGX_HAVE_CRYPT"
 ngx_feature_run=no
--- a/src/event/modules/ngx_kqueue_module.c	Tue Jul 08 22:45:33 2025 +0400
+++ b/src/event/modules/ngx_kqueue_module.c	Thu Jul 10 16:30:35 2025 +0400
@@ -10,6 +10,15 @@
 #include <ngx_event.h>
 
 
+/* NetBSD 2.0 incompatibly defines kevent.udata as "intptr_t" */
+
+#if (__NetBSD__)
+#define NGX_KQUEUE_UDATA_T
+#else
+#define NGX_KQUEUE_UDATA_T  (void *)
+#endif
+
+
 typedef struct {
     ngx_uint_t  changes;
     ngx_uint_t  events;