Skip to content

Commit d5536a3

Browse files
committed
Fix some fallout from prior
1 parent 60594cd commit d5536a3

File tree

4 files changed

+22
-1
lines changed

4 files changed

+22
-1
lines changed

configure

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1218,7 +1218,7 @@ EOF
12181218
rm -f _rbtree.c _rbtree
12191219
fi
12201220
if [ "$RBTREE" = no ]; then
1221-
echo "#define RBLOCAL" >>$CONFIG_H
1221+
echo "RBTREE_CPPFLAGS= -DRBLOCAL" >>$CONFIG_MK
12221222
echo "VENDOR_SRCS+= vendor/rbtree.c" >>$CONFIG_MK
12231223
else
12241224
echo "#define HAVE_SYS_RBTREE_H" >>$CONFIG_H

src/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ all: ${TOP}/config.h ${PROG} ${SCRIPTS} ${MAN5} ${MAN8}
5555
dev:
5656
cd dev && ${MAKE}
5757

58+
../vendor/rbtree.o:
59+
${CC} ${CFLAGS} ${CPPFLAGS} ${RBTREE_CFLAGS} ${RBTREE_CPPFLAGS} -c $< -o $@
60+
5861
.c.o:
5962
${CC} ${CFLAGS} ${CPPFLAGS} -c $< -o $@
6063

src/control.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include <stdbool.h>
3333

3434
#include "dhcpcd.h"
35+
#include "queue.h"
3536

3637
#if !defined(CTL_FREE_LIST)
3738
#define CTL_FREE_LIST 1

src/queue.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/*
2+
* This stub exists becuase we know a modern BSD supports all TAILQ
3+
* and glibc, musl et all, don't.
4+
*/
5+
#if (defined(__unix__) || defined(unix)) && !defined(USG)
6+
#include <sys/param.h>
7+
#endif
8+
#ifdef BSD
9+
#include <sys/queue.h>
10+
/* Dragonfly BSD needs this :( */
11+
#if !defined(TAILQ_FOREACH_SAFE) && defined(TAILQ_FOREACH_MUTABLE)
12+
#define TAILQ_FOREACH_SAFE TAILQ_FOREACH_MUTABLE
13+
#endif
14+
#else
15+
#error
16+
#include "../vendor/queue.h"
17+
#endif

0 commit comments

Comments
 (0)