]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix some fallout from prior
authorRoy Marples <roy@marples.name>
Thu, 30 Oct 2025 19:08:32 +0000 (19:08 +0000)
committerRoy Marples <roy@marples.name>
Thu, 30 Oct 2025 19:08:32 +0000 (19:08 +0000)
configure
src/Makefile
src/control.h
src/queue.h [new file with mode: 0644]

index a0243dacba5cedf168ee5a31218785f7e4e47b66..47371e1fee31f9e74dd41e2952c3d88ab21da684 100755 (executable)
--- a/configure
+++ b/configure
@@ -1218,7 +1218,7 @@ EOF
        rm -f _rbtree.c _rbtree
 fi
 if [ "$RBTREE" = no ]; then
-       echo "#define   RBLOCAL" >>$CONFIG_H
+       echo "RBTREE_CPPFLAGS=          -DRBLOCAL" >>$CONFIG_MK
        echo "VENDOR_SRCS+=     vendor/rbtree.c" >>$CONFIG_MK
 else
        echo "#define   HAVE_SYS_RBTREE_H" >>$CONFIG_H
index f308ae1a95a4a5eb73d95b2e22dcc5565edf1c96..65a7397175e1cb4b6771b912acf43f8e3dba8d0f 100644 (file)
@@ -55,6 +55,9 @@ all: ${TOP}/config.h ${PROG} ${SCRIPTS} ${MAN5} ${MAN8}
 dev:
        cd dev && ${MAKE}
 
+../vendor/rbtree.o:
+       ${CC} ${CFLAGS} ${CPPFLAGS} ${RBTREE_CFLAGS} ${RBTREE_CPPFLAGS} -c $< -o $@
+
 .c.o:
        ${CC} ${CFLAGS} ${CPPFLAGS} -c $< -o $@
 
index 8a3d3d590e4038786d713755da9797ac707fa7be..ef5922689e57487f234c11326439b5cf18782e54 100644 (file)
@@ -32,6 +32,7 @@
 #include <stdbool.h>
 
 #include "dhcpcd.h"
+#include "queue.h"
 
 #if !defined(CTL_FREE_LIST)
 #define        CTL_FREE_LIST 1
diff --git a/src/queue.h b/src/queue.h
new file mode 100644 (file)
index 0000000..efc69ab
--- /dev/null
@@ -0,0 +1,17 @@
+/*
+ * This stub exists becuase we know a modern BSD supports all TAILQ
+ * and glibc, musl et all, don't.
+ */
+#if (defined(__unix__) || defined(unix)) && !defined(USG)
+#include <sys/param.h>
+#endif
+#ifdef BSD
+#include <sys/queue.h>
+/* Dragonfly BSD needs this :( */
+#if !defined(TAILQ_FOREACH_SAFE) && defined(TAILQ_FOREACH_MUTABLE)
+#define        TAILQ_FOREACH_SAFE      TAILQ_FOREACH_MUTABLE
+#endif
+#else
+#error
+#include "../vendor/queue.h"
+#endif