Sun Dec 13 21:56:27 2015 UTC ()
Always redefine TAILQ_FOREACH_REVERSE. Mac OS X Tiger has a version with
the third and fourth argument swapped.


(joerg)
diff -r1.8 -r1.9 pkgsrc/pkgtools/libnbcompat/files/nbcompat/queue.h

cvs diff -r1.8 -r1.9 pkgsrc/pkgtools/libnbcompat/files/nbcompat/queue.h (expand / switch to unified diff)

--- pkgsrc/pkgtools/libnbcompat/files/nbcompat/queue.h 2009/03/02 13:54:56 1.8
+++ pkgsrc/pkgtools/libnbcompat/files/nbcompat/queue.h 2015/12/13 21:56:27 1.9
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: queue.h,v 1.8 2009/03/02 13:54:56 joerg Exp $ */ 1/* $NetBSD: queue.h,v 1.9 2015/12/13 21:56:27 joerg Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1991, 1993 4 * Copyright (c) 1991, 1993
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -296,32 +296,31 @@ struct { \ @@ -296,32 +296,31 @@ struct { \
296#define TAILQ_FOREACH(var, head, field) \ 296#define TAILQ_FOREACH(var, head, field) \
297 for ((var) = ((head)->tqh_first); \ 297 for ((var) = ((head)->tqh_first); \
298 (var); \ 298 (var); \
299 (var) = ((var)->field.tqe_next)) 299 (var) = ((var)->field.tqe_next))
300#endif 300#endif
301 301
302#ifndef TAILQ_FOREACH_SAFE 302#ifndef TAILQ_FOREACH_SAFE
303#define TAILQ_FOREACH_SAFE(var, head, field, next) \ 303#define TAILQ_FOREACH_SAFE(var, head, field, next) \
304 for ((var) = ((head)->tqh_first); \ 304 for ((var) = ((head)->tqh_first); \
305 (var) != NULL && ((next) = TAILQ_NEXT(var, field), 1); \ 305 (var) != NULL && ((next) = TAILQ_NEXT(var, field), 1); \
306 (var) = (next)) 306 (var) = (next))
307#endif 307#endif
308 308
309#ifndef TAILQ_FOREACH_REVERSE 309#undef TAILQ_FOREACH_REVERSE
310#define TAILQ_FOREACH_REVERSE(var, head, headname, field) \ 310#define TAILQ_FOREACH_REVERSE(var, head, headname, field) \
311 for ((var) = (*(((struct headname *)((head)->tqh_last))->tqh_last)); \ 311 for ((var) = (*(((struct headname *)((head)->tqh_last))->tqh_last)); \
312 (var); \ 312 (var); \
313 (var) = (*(((struct headname *)((var)->field.tqe_prev))->tqh_last))) 313 (var) = (*(((struct headname *)((var)->field.tqe_prev))->tqh_last)))
314#endif 
315 314
316#ifndef TAILQ_EMPTY 315#ifndef TAILQ_EMPTY
317#define TAILQ_EMPTY(head) ((head)->tqh_first == NULL) 316#define TAILQ_EMPTY(head) ((head)->tqh_first == NULL)
318#endif 317#endif
319#ifndef TAILQ_FIRST 318#ifndef TAILQ_FIRST
320#define TAILQ_FIRST(head) ((head)->tqh_first) 319#define TAILQ_FIRST(head) ((head)->tqh_first)
321#endif 320#endif
322#ifndef TAILQ_NEXT 321#ifndef TAILQ_NEXT
323#define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next) 322#define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next)
324#endif 323#endif
325 324
326#ifndef TAILQ_LAST 325#ifndef TAILQ_LAST
327#define TAILQ_LAST(head, headname) \ 326#define TAILQ_LAST(head, headname) \