]> git.feebdaed.xyz Git - 0xmirror/nginx.git/commitdiff
Configure: set NGX_KQUEUE_UDATA_T at compile time.
authorSergey Kandaurov <pluknet@nginx.com>
Thu, 10 Jul 2025 12:30:35 +0000 (16:30 +0400)
committerpluknet <pluknet@nginx.com>
Fri, 11 Jul 2025 12:25:51 +0000 (16:25 +0400)
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.

auto/unix
src/event/modules/ngx_kqueue_module.c

index 0dd66cfcd6f81f1df6b5f025a17ef022217d8468..6087e04fd6afc31bfde28bbeb1b90598cc177b64 100644 (file)
--- a/auto/unix
+++ b/auto/unix
@@ -129,26 +129,6 @@ if test -z "$NGX_KQUEUE_CHECKED"; then
 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
index fb8a6527c4a6eab5dd0565f610399102dc1d406e..2ed862e9e1ea4104cfbcdc549f81af92819050e5 100644 (file)
 #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;