From a5a0ceb06b8cf6e5331248869079fbb060d6f6dd Mon Sep 17 00:00:00 2001 From: joerg Date: Thu, 26 Feb 2009 16:14:18 +0000 Subject: Provide TAILQ_FOREACH_SAFE if it is missing. --- pkgtools/libnbcompat/Makefile | 4 ++-- pkgtools/libnbcompat/files/nbcompat/queue.h | 9 ++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/pkgtools/libnbcompat/Makefile b/pkgtools/libnbcompat/Makefile index 5d66a6a6fc3..37cf49c908c 100644 --- a/pkgtools/libnbcompat/Makefile +++ b/pkgtools/libnbcompat/Makefile @@ -1,11 +1,11 @@ -# $NetBSD: Makefile,v 1.67 2008/10/29 11:23:17 joerg Exp $ +# $NetBSD: Makefile,v 1.68 2009/02/26 16:14:18 joerg Exp $ # # NOTE: If you update this package, it is *mandatory* that you update # pkgsrc/pkgtools/libnbcompat/files/README to reflect the actual # list of tested and supported platforms. # -DISTNAME= libnbcompat-20081029 +DISTNAME= libnbcompat-20090226 CATEGORIES= pkgtools devel MASTER_SITES= # empty DISTFILES= # empty 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)); \ -- cgit v1.2.3