From: Roy Marples Date: Fri, 31 Oct 2025 07:28:53 +0000 (+0000) Subject: Fix compile with rbtree and queue on Linux X-Git-Tag: v10.3.0~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=760a3d27f7c025939d6ba39389bb284bfb31f97b;p=thirdparty%2Fdhcpcd.git Fix compile with rbtree and queue on Linux --- diff --git a/configure b/configure index 47371e1f..66024f16 100755 --- a/configure +++ b/configure @@ -1220,6 +1220,12 @@ fi if [ "$RBTREE" = no ]; then echo "RBTREE_CPPFLAGS= -DRBLOCAL" >>$CONFIG_MK echo "VENDOR_SRCS+= vendor/rbtree.c" >>$CONFIG_MK + # Tell rbtree.c to #include "rbtree.h" rather than sys/rbtree.h + echo "RBTREE_CPPFLAGS+= -DRBLOCAL" >>$CONFIG_MK + # Remove unused warning from compile + echo "RBTREE_CPPFLAGS+= \"-D__unused=__attribute__((__unused__))\"" >>$CONFIG_MK + # Enjoy the same optimisation as NetBSD's libc + echo "RBTREE_CPPFLAGS+= \"-D__predict_false(exp)=__builtin_expect((exp) ? 1 : 0, 0)\"" >>$CONFIG_MK else echo "#define HAVE_SYS_RBTREE_H" >>$CONFIG_H fi diff --git a/src/Makefile b/src/Makefile index 65a73971..01ab319b 100644 --- a/src/Makefile +++ b/src/Makefile @@ -56,7 +56,7 @@ dev: cd dev && ${MAKE} ../vendor/rbtree.o: - ${CC} ${CFLAGS} ${CPPFLAGS} ${RBTREE_CFLAGS} ${RBTREE_CPPFLAGS} -c $< -o $@ + ${CC} ${CFLAGS} ${CPPFLAGS} ${RBTREE_CFLAGS} ${RBTREE_CPPFLAGS} -c ../vendor/rbtree.c -o $@ .c.o: ${CC} ${CFLAGS} ${CPPFLAGS} -c $< -o $@ diff --git a/src/auth.h b/src/auth.h index 2c0676ff..fbffd8ed 100644 --- a/src/auth.h +++ b/src/auth.h @@ -29,6 +29,8 @@ #ifndef AUTH_H #define AUTH_H +#include + #include "queue.h" #define DHCPCD_AUTH_SEND (1 << 0) diff --git a/src/queue.h b/src/queue.h index efc69ab6..d83fc62c 100644 --- a/src/queue.h +++ b/src/queue.h @@ -12,6 +12,5 @@ #define TAILQ_FOREACH_SAFE TAILQ_FOREACH_MUTABLE #endif #else -#error #include "../vendor/queue.h" #endif