aboutsummaryrefslogtreecommitdiff
path: root/sys/sys
diff options
context:
space:
mode:
authorAlex Richardson <arichardson@FreeBSD.org>2021-01-25 14:11:45 +0000
committerAlex Richardson <arichardson@FreeBSD.org>2021-01-25 15:09:35 +0000
commit8d55837dc1331a5cdacad539b1788ab1070159b4 (patch)
tree75dd7f7f92b949e894df4af13e947ddbca748dd3 /sys/sys
parent3454fa118c41a588e2dad20614325297c989c60b (diff)
downloadsrc-8d55837dc1331a5cdacad539b1788ab1070159b4.tar.gz
src-8d55837dc1331a5cdacad539b1788ab1070159b4.zip
qeueue.h: Add {SLIST,STAILQ,LIST,TAILQ}_END()
We provide these for compat with other queue.h headers since some software assumes it exists (e.g. the libevent contrib code), but we are not encouraging their use (NULL should be used instead). This fixes the following warning (which should arguable be an error since it results in a function call to an undefined function): .../contrib/libevent/buffer.c:495:16: warning: implicit declaration of function 'LIST_END' is invalid in C99 [-Wimplicit-function-declaration] cbent != LIST_END(&buffer->callbacks); ^ .../contrib/libevent/buffer.c:495:13: warning: comparison between pointer and integer ('struct evbuffer_cb_entry *' and 'int') [-Wpointer-integer-compare] cbent != LIST_END(&buffer->callbacks); ~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Reviewed By: jhb Differential Revision: https://reviews.freebsd.org/D27151
Diffstat (limited to 'sys/sys')
-rw-r--r--sys/sys/queue.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/sys/queue.h b/sys/sys/queue.h
index 14d55905dfc0..25091ec815f1 100644
--- a/sys/sys/queue.h
+++ b/sys/sys/queue.h
@@ -91,6 +91,7 @@
* _CLASS_ENTRY + + + +
* _INIT + + + +
* _EMPTY + + + +
+ * _END + + + +
* _FIRST + + + +
* _NEXT + + + +
* _PREV - + - +
@@ -305,6 +306,8 @@ struct { \
SLIST_FIRST(head2) = swap_first; \
} while (0)
+#define SLIST_END(head) NULL
+
/*
* Singly-linked Tail queue declarations.
*/
@@ -437,6 +440,9 @@ struct { \
(head2)->stqh_last = &STAILQ_FIRST(head2); \
} while (0)
+#define STAILQ_END(head) NULL
+
+
/*
* List declarations.
*/
@@ -611,6 +617,8 @@ struct { \
swap_tmp->field.le_prev = &LIST_FIRST((head2)); \
} while (0)
+#define LIST_END(head) NULL
+
/*
* Tail queue declarations.
*/
@@ -867,4 +875,6 @@ struct { \
(head2)->tqh_last = &(head2)->tqh_first; \
} while (0)
+#define TAILQ_END(head) NULL
+
#endif /* !_SYS_QUEUE_H_ */