From f2522b43139cc1a41a4a75d9eff84ee40be408da Mon Sep 17 00:00:00 2001 From: Omar Polo Date: Wed, 31 Mar 2021 16:52:07 +0000 Subject: [PATCH] check if sys/queue.h provides TAILQ_FOREACH_SAFE --- have/queue_h.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/have/queue_h.c b/have/queue_h.c index d503040..81d3c61 100644 --- a/have/queue_h.c +++ b/have/queue_h.c @@ -18,12 +18,18 @@ #include -struct ibuf { - TAILQ_ENTRY(ibuf) entry; -}; +TAILQ_HEAD(tailhead, entry) head; +struct entry { + TAILQ_ENTRY(entry) entries; +} *np, *nt; int main(void) { + TAILQ_INIT(&head); + TAILQ_FOREACH_SAFE(np, &head, entries, nt) { + /* nop */; + } + return 0; }