Skip to content

Commit 413d4b7

Browse files
committed
shims: TAILQ_FOREACH_SAFE is unavailable in glibc
TAILQ_FOREACH_SAFE is a BSD specific macro. Provide a definition for it in the Linux shims.
1 parent dfab04b commit 413d4b7

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/shims/linux_stubs.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,16 @@
1616
#ifndef __DISPATCH__STUBS__INTERNAL
1717
#define __DISPATCH__STUBS__INTERNAL
1818

19+
#if !defined(TAILQ_FOREACH_SAFE)
20+
#define TAILQ_FOREACH_SAFE(var, head, field, temp) \
21+
for ((var) = TAILQ_FIRST((head)); \
22+
(var) && ((temp) = TAILQ_NEXT((var), field), 1); (var) = (temp))
23+
#endif
24+
25+
#if !defined(TRASHIT)
26+
#define TRASHIT(x) do { (x) = (void *)-1; } while (0)
27+
#endif
28+
1929
/*
2030
* Stub out defines for some mach types and related macros
2131
*/

0 commit comments

Comments
 (0)