diff options
Diffstat (limited to 'openbsd-compat/fake-queue.h')
-rw-r--r-- | openbsd-compat/fake-queue.h | 15 |
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 | */ |