summaryrefslogtreecommitdiff
path: root/openbsd-compat/fake-queue.h
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2002-02-13 16:00:15 +1100
committerDamien Miller <djm@mindrot.org>2002-02-13 16:00:15 +1100
commit8e3bdca1da7d30542e9028f35f2a1cef052c85e4 (patch)
tree4c05c79248820c0c128db51a2cd2c74220cd66e8 /openbsd-compat/fake-queue.h
parent3db5f530d0fdf8044d6014ab12940efe0bbecca7 (diff)
- (djm) Sync openbsd-compat with OpenBSD CVS too
Diffstat (limited to 'openbsd-compat/fake-queue.h')
-rw-r--r--openbsd-compat/fake-queue.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/openbsd-compat/fake-queue.h b/openbsd-compat/fake-queue.h
index 269af413c..c85bb240c 100644
--- a/openbsd-compat/fake-queue.h
+++ b/openbsd-compat/fake-queue.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: queue.h,v 1.16 2000/09/07 19:47:59 art Exp $ */ 1/* $OpenBSD: queue.h,v 1.22 2001/06/23 04:39:35 angelos Exp $ */
2/* $NetBSD: queue.h,v 1.11 1996/05/16 05:17:14 mycroft Exp $ */ 2/* $NetBSD: queue.h,v 1.11 1996/05/16 05:17:14 mycroft Exp $ */
3 3
4/* 4/*
@@ -136,6 +136,19 @@ struct { \
136 (head)->slh_first = (head)->slh_first->field.sle_next; \ 136 (head)->slh_first = (head)->slh_first->field.sle_next; \
137} while (0) 137} while (0)
138 138
139#define SLIST_REMOVE(head, elm, type, field) do { \
140 if ((head)->slh_first == (elm)) { \
141 SLIST_REMOVE_HEAD((head), field); \
142 } \
143 else { \
144 struct type *curelm = (head)->slh_first; \
145 while( curelm->field.sle_next != (elm) ) \
146 curelm = curelm->field.sle_next; \
147 curelm->field.sle_next = \
148 curelm->field.sle_next->field.sle_next; \
149 } \
150} while (0)
151
139/* 152/*
140 * List definitions. 153 * List definitions.
141 */ 154 */