Skip to content

Commit 1f1dfa5

Browse files
cvinayakkartben
authored andcommitted
linker: Fix DT_NODE_HAS_STATUS and DT_NODE_HAS_STATUS_OKAY redefined
Fix ‘DT_NODE_HAS_STATUS’ and ‘DT_NODE_HAS_STATUS_OKAY’ redefined warning. Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
1 parent aa6f87d commit 1f1dfa5

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

include/zephyr/linker/linker-defs.h

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,22 @@
2525
#include <zephyr/sys/util.h>
2626
#include <zephyr/offsets.h>
2727

28-
/* We need to dummy out DT_NODE_HAS_STATUS when building the unittests.
28+
/* We need to dummy out DT_NODE_HAS_STATUS and DT_NODE_HAS_STATUS_OKAY when
29+
* building the unittests.
2930
* Including devicetree.h would require generating dummy header files
3031
* to match what gen_defines creates, so it's easier to just dummy out
31-
* DT_NODE_HAS_STATUS. These are undefined at the end of the file.
32+
* DT_NODE_HAS_STATUS and DT_NODE_HAS_STATUS_OKAY. These are undefined at the
33+
* end of the file.
3234
*/
3335
#ifdef ZTEST_UNITTEST
36+
#ifdef DT_NODE_HAS_STATUS
37+
#undef DT_NODE_HAS_STATUS
38+
#endif
3439
#define DT_NODE_HAS_STATUS(node, status) 0
40+
41+
#ifdef DT_NODE_HAS_STATUS_OKAY
42+
#undef DT_NODE_HAS_STATUS_OKAY
43+
#endif
3544
#define DT_NODE_HAS_STATUS_OKAY(node) 0
3645
#else
3746
#include <zephyr/devicetree.h>

0 commit comments

Comments
 (0)