diff --git a/include/zephyr/linker/linker-defs.h b/include/zephyr/linker/linker-defs.h index 9c795ae7851..14bbc250f4c 100644 --- a/include/zephyr/linker/linker-defs.h +++ b/include/zephyr/linker/linker-defs.h @@ -28,7 +28,7 @@ /* We need to dummy out DT_NODE_HAS_STATUS when building the unittests. * Including devicetree.h would require generating dummy header files * to match what gen_defines creates, so it's easier to just dummy out - * DT_NODE_HAS_STATUS. + * DT_NODE_HAS_STATUS. These are undefined at the end of the file. */ #ifdef ZTEST_UNITTEST #define DT_NODE_HAS_STATUS(node, status) 0 @@ -359,4 +359,9 @@ extern char lnkr_ondemand_rodata_size[]; #endif /* CONFIG_LINKER_USE_ONDEMAND_SECTION */ #endif /* ! _ASMLANGUAGE */ +#ifdef ZTEST_UNITTEST +#undef DT_NODE_HAS_STATUS +#undef DT_NODE_HAS_STATUS_OKAY +#endif + #endif /* ZEPHYR_INCLUDE_LINKER_LINKER_DEFS_H_ */