summaryrefslogtreecommitdiff
path: root/pkgtools/libnbcompat/files/nbcompat/queue.h
diff options
context:
space:
mode:
Diffstat (limited to 'pkgtools/libnbcompat/files/nbcompat/queue.h')
-rw-r--r--pkgtools/libnbcompat/files/nbcompat/queue.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/pkgtools/libnbcompat/files/nbcompat/queue.h b/pkgtools/libnbcompat/files/nbcompat/queue.h
index ed400d81a95..9042d2cb801 100644
--- a/pkgtools/libnbcompat/files/nbcompat/queue.h
+++ b/pkgtools/libnbcompat/files/nbcompat/queue.h
@@ -1,4 +1,4 @@
-/* $NetBSD: queue.h,v 1.6 2008/11/06 00:25:42 joerg Exp $ */
+/* $NetBSD: queue.h,v 1.7 2009/02/26 16:14:18 joerg Exp $ */
/*
* Copyright (c) 1991, 1993
@@ -299,6 +299,13 @@ struct { \
(var) = ((var)->field.tqe_next))
#endif
+#ifndef TAILQ_FOREACH_SAFE
+#define TAILQ_FOREACH_SAFE(var, head, field, next) \
+ for ((var) = ((head)->tqh_first); \
+ (var) != NULL && ((next) = TAILQ_NEXT(var, field), 1); \
+ (var) = (next))
+#endif
+
#ifndef TAILQ_FOREACH_REVERSE
#define TAILQ_FOREACH_REVERSE(var, head, headname, field) \
for ((var) = (*(((struct headname *)((head)->tqh_last))->tqh_last)); \