From: David van Moolenbroek Date: Fri, 23 Dec 2011 18:05:09 +0000 (+0100) Subject: sys/queue.h: add LIST_FOREACH_SAFE to netbsd copy X-Git-Tag: v3.2.0~151 X-Git-Url: http://zhaoyanbai.com/repos/icons/apache_pb.png?a=commitdiff_plain;h=c21cdd3154745e9966229eee6a958117ce4ddd52;p=minix.git sys/queue.h: add LIST_FOREACH_SAFE to netbsd copy --- diff --git a/nbsd_include/sys/queue.h b/nbsd_include/sys/queue.h index 4c72a39dd..91a83423b 100644 --- a/nbsd_include/sys/queue.h +++ b/nbsd_include/sys/queue.h @@ -166,6 +166,11 @@ struct { \ (var); \ (var) = ((var)->field.le_next)) +#define LIST_FOREACH_SAFE(var, head, field, tvar) \ + for ((var) = LIST_FIRST((head)); \ + (var) && ((tvar) = LIST_NEXT((var), field), 1); \ + (var) = (tvar)) + /* * List access methods. */