check if sys/queue.h provides TAILQ_FOREACH_SAFE

This commit is contained in:
Omar Polo 2021-03-31 16:52:07 +00:00
parent b8e64ccd44
commit f2522b4313
1 changed files with 9 additions and 3 deletions

View File

@ -18,12 +18,18 @@
#include <stddef.h>
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;
}