aboutsummaryrefslogtreecommitdiff
path: root/have
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2021-03-31 16:52:07 +0000
committerOmar Polo <op@omarpolo.com>2021-03-31 16:52:07 +0000
commitf2522b43139cc1a41a4a75d9eff84ee40be408da (patch)
treef15fdddb2e8a457f254f8826ebb530c8a1042194 /have
parentb8e64ccd44290cdd34bdcd3fd85fb1a9cb7486dd (diff)
check if sys/queue.h provides TAILQ_FOREACH_SAFE
Diffstat (limited to 'have')
-rw-r--r--have/queue_h.c12
1 files 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 <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;
}