From 7700e6fe796cabfa22eefddc024d66257a28d4dc Mon Sep 17 00:00:00 2001
From: William Hubbs <w.d.hubbs@gmail.com>
Date: Fri, 24 Oct 2014 10:44:14 -0500
Subject: Fix compile errors created by bundling queue.h

---
 src/librc/rc.h.in | 45 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)

(limited to 'src/librc')

diff --git a/src/librc/rc.h.in b/src/librc/rc.h.in
index 62119e9f..58d8eb57 100644
--- a/src/librc/rc.h.in
+++ b/src/librc/rc.h.in
@@ -77,6 +77,51 @@ extern "C" {
 #  define RC_LOCAL_CONFDIR      RC_LOCAL_PREFIX "/etc/conf.d"
 #endif
 
+#ifndef _SYS_QUEUE_H_
+
+/*
+ * The following are copied directly from our imported queue.h.
+ */
+
+/*
+ * List definitions.
+ */
+#define	LIST_HEAD(name, type)						\
+struct name {								\
+	struct type *lh_first;	/* first element */			\
+}
+
+#define	LIST_HEAD_INITIALIZER(head)					\
+	{ NULL }
+
+#define	LIST_ENTRY(type)						\
+struct {								\
+	struct type *le_next;	/* next element */			\
+	struct type **le_prev;	/* address of previous next element */	\
+}
+
+/*
+ * Tail queue definitions.
+ */
+#define	_TAILQ_HEAD(name, type, qual)					\
+struct name {								\
+	qual type *tqh_first;		/* first element */		\
+	qual type *qual *tqh_last;	/* addr of last next element */	\
+}
+#define TAILQ_HEAD(name, type)	_TAILQ_HEAD(name, struct type,)
+
+#define	TAILQ_HEAD_INITIALIZER(head)					\
+	{ TAILQ_END(head), &(head).tqh_first }
+
+#define	_TAILQ_ENTRY(type, qual)					\
+struct {								\
+	qual type *tqe_next;		/* next element */		\
+	qual type *qual *tqe_prev;	/* address of previous next element */\
+}
+#define TAILQ_ENTRY(type)	_TAILQ_ENTRY(struct type,)
+
+#endif /* _SYS_QUEUE_H_ */
+
 /* A doubly linked list using queue(3) for ease of use */
 typedef struct rc_string {
 	char *value;
-- 
cgit v1.2.3