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
--- /dev/null
+/*
+ * 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