summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMatthew Dempsky <matthew@cvs.openbsd.org>2011-07-03 16:08:41 +0000
committerMatthew Dempsky <matthew@cvs.openbsd.org>2011-07-03 16:08:41 +0000
commitfb4a823d92ba09457cf76befa7f6ea5387b4c6d3 (patch)
treeff150111c73a0d29ffd282da6dec0eb3fcc3c567 /sys
parentcf51fdce33cceb21f045884bd8ac674d82bb7fa5 (diff)
Add a SIMPLEQ_REMOVE_NEXT() macro analogous to SLIST_REMOVE_NEXT().
ok krw@
Diffstat (limited to 'sys')
-rw-r--r--sys/sys/queue.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/sys/queue.h b/sys/sys/queue.h
index 38130e08152..7f961edaa28 100644
--- a/sys/sys/queue.h
+++ b/sys/sys/queue.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: queue.h,v 1.32 2007/04/30 18:42:34 pedro Exp $ */
+/* $OpenBSD: queue.h,v 1.33 2011/07/03 16:08:40 matthew Exp $ */
/* $NetBSD: queue.h,v 1.11 1996/05/16 05:17:14 mycroft Exp $ */
/*
@@ -300,6 +300,12 @@ struct { \
(head)->sqh_last = &(head)->sqh_first; \
} while (0)
+#define SIMPLEQ_REMOVE_NEXT(head, elm, field) do { \
+ if (((elm)->field.sqe_next = (elm)->field.sqe_next->field.sqe_next) \
+ == NULL) \
+ (head)->sqh_last = &(elm)->field.sqe_next; \
+} while (0)
+
/*
* Tail queue definitions.
*/