Skip to content

Commit 18caf49

Browse files
committed
extmod/modbtree: Undefine queue macros before including berkeley-db.
To prevent warnings when building with ESP IDF v5. Signed-off-by: Damien George <[email protected]>
1 parent 402fdc4 commit 18caf49

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

extmod/modbtree.c

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,31 @@
3232
#include <stdio.h>
3333
#include <errno.h> // for declaration of global errno variable
3434
#include <fcntl.h>
35+
36+
// Undefine queue macros that will be defined in berkeley-db-1.xx headers
37+
// below, in case they clash with system ones defined in headers above.
38+
#undef LIST_HEAD
39+
#undef LIST_ENTRY
40+
#undef LIST_INIT
41+
#undef LIST_INSERT_AFTER
42+
#undef LIST_INSERT_HEAD
43+
#undef LIST_REMOVE
44+
#undef TAILQ_HEAD
45+
#undef TAILQ_ENTRY
46+
#undef TAILQ_INIT
47+
#undef TAILQ_INSERT_HEAD
48+
#undef TAILQ_INSERT_TAIL
49+
#undef TAILQ_INSERT_AFTER
50+
#undef TAILQ_REMOVE
51+
#undef CIRCLEQ_HEAD
52+
#undef CIRCLEQ_ENTRY
53+
#undef CIRCLEQ_INIT
54+
#undef CIRCLEQ_INSERT_AFTER
55+
#undef CIRCLEQ_INSERT_BEFORE
56+
#undef CIRCLEQ_INSERT_HEAD
57+
#undef CIRCLEQ_INSERT_TAIL
58+
#undef CIRCLEQ_REMOVE
59+
3560
#include <db.h>
3661
#include <../../btree/btree.h>
3762

0 commit comments

Comments
 (0)