From 8e3bdca1da7d30542e9028f35f2a1cef052c85e4 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Wed, 13 Feb 2002 16:00:15 +1100 Subject: - (djm) Sync openbsd-compat with OpenBSD CVS too --- openbsd-compat/fake-queue.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'openbsd-compat/fake-queue.h') 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 @@ -/* $OpenBSD: queue.h,v 1.16 2000/09/07 19:47:59 art Exp $ */ +/* $OpenBSD: queue.h,v 1.22 2001/06/23 04:39:35 angelos Exp $ */ /* $NetBSD: queue.h,v 1.11 1996/05/16 05:17:14 mycroft Exp $ */ /* @@ -136,6 +136,19 @@ struct { \ (head)->slh_first = (head)->slh_first->field.sle_next; \ } while (0) +#define SLIST_REMOVE(head, elm, type, field) do { \ + if ((head)->slh_first == (elm)) { \ + SLIST_REMOVE_HEAD((head), field); \ + } \ + else { \ + struct type *curelm = (head)->slh_first; \ + while( curelm->field.sle_next != (elm) ) \ + curelm = curelm->field.sle_next; \ + curelm->field.sle_next = \ + curelm->field.sle_next->field.sle_next; \ + } \ +} while (0) + /* * List definitions. */ -- cgit v1.2.3