From dfb9f11be3bcb1bb07e4c41cb40be973fdb8107e Mon Sep 17 00:00:00 2001 From: Peter Bigot Date: Tue, 11 Aug 2020 16:00:00 -0500 Subject: [PATCH] ztest: make arc/cpu.h override C++ safe This override header declares structures and inline functions, which must be given C language linkage to avoid conflicting declaration errors with other headers. Signed-off-by: Peter Bigot --- subsys/testsuite/ztest/include/arch/cpu.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/subsys/testsuite/ztest/include/arch/cpu.h b/subsys/testsuite/ztest/include/arch/cpu.h index 8db9eea49d1..61bba9751b4 100644 --- a/subsys/testsuite/ztest/include/arch/cpu.h +++ b/subsys/testsuite/ztest/include/arch/cpu.h @@ -6,6 +6,10 @@ /* This file exists as a hack around Zephyr's dependencies */ +#ifdef __cplusplus +extern "C" { +#endif + /* Architecture thread structure */ struct _callee_saved { }; @@ -38,6 +42,10 @@ static inline bool arch_irq_unlocked(unsigned int key) return 0; } +#ifdef __cplusplus +} +#endif /* __cplusplus */ + #include