diff --git a/lib/libc/minimal/include/time.h b/lib/libc/minimal/include/time.h index d23e9296eaf59..2de85621d1632 100644 --- a/lib/libc/minimal/include/time.h +++ b/lib/libc/minimal/include/time.h @@ -11,6 +11,7 @@ #include #include #include +#include /* Minimal time.h to fulfill the requirements of certain libraries * like mbedTLS and to support time APIs. @@ -42,8 +43,6 @@ typedef _TIME_T_ time_t; typedef _SUSECONDS_T_ suseconds_t; #endif -#include - /* * Conversion between civil time and UNIX time. The companion * localtime() and inverse mktime() are not provided here since they diff --git a/samples/subsys/logging/logger/src/sample_module.h b/samples/subsys/logging/logger/src/sample_module.h index 0a80a214a6b5d..6293793c94436 100644 --- a/samples/subsys/logging/logger/src/sample_module.h +++ b/samples/subsys/logging/logger/src/sample_module.h @@ -6,10 +6,11 @@ #ifndef SAMPLE_MODULE_H #define SAMPLE_MODULE_H +#include + #ifdef __cplusplus extern "C" { #endif -#include #define MODULE_NAME sample_module diff --git a/subsys/debug/tracing/include/tracing_ctf.h b/subsys/debug/tracing/include/tracing_ctf.h index 041a4f316837e..3a300354a917e 100644 --- a/subsys/debug/tracing/include/tracing_ctf.h +++ b/subsys/debug/tracing/include/tracing_ctf.h @@ -7,14 +7,14 @@ #ifndef _TRACE_CTF_H #define _TRACE_CTF_H -#ifdef __cplusplus -extern "C" { -#endif - #include #include #include +#ifdef __cplusplus +extern "C" { +#endif + void sys_trace_thread_switched_out(void); void sys_trace_thread_switched_in(void); void sys_trace_thread_priority_set(struct k_thread *thread); diff --git a/subsys/testsuite/ztest/include/ztest.h b/subsys/testsuite/ztest/include/ztest.h index 5ffe0ab6dff5e..344cc63a6949e 100644 --- a/subsys/testsuite/ztest/include/ztest.h +++ b/subsys/testsuite/ztest/include/ztest.h @@ -20,10 +20,6 @@ #ifndef __ZTEST_H__ #define __ZTEST_H__ -#ifdef __cplusplus -extern "C" { -#endif - /** * @defgroup ztest Zephyr testing suite */ @@ -44,21 +40,30 @@ extern "C" { /* FIXME: Properly integrate with Zephyr's arch specific code */ #define CONFIG_X86 1 #define CONFIG_PRINTK 1 +#ifdef __cplusplus +extern "C" { +#endif struct esf; typedef struct esf z_arch_esf_t; +#ifdef __cplusplus +} #endif +#endif /* KERNEL */ #include #define PRINT printk #include - #include #include #include #include +#ifdef __cplusplus +extern "C" { +#endif + void test_main(void); #ifdef __cplusplus diff --git a/subsys/testsuite/ztest/include/ztest_assert.h b/subsys/testsuite/ztest/include/ztest_assert.h index 9962da7dbe304..b1d7f163f0754 100644 --- a/subsys/testsuite/ztest/include/ztest_assert.h +++ b/subsys/testsuite/ztest/include/ztest_assert.h @@ -19,6 +19,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + void ztest_test_fail(void); #if CONFIG_ZTEST_ASSERT_VERBOSE == 0 @@ -214,4 +218,8 @@ static inline void z_zassert(int cond, * @} */ +#ifdef __cplusplus +} +#endif + #endif /* __ZTEST_ASSERT_H__ */ diff --git a/subsys/testsuite/ztest/include/ztest_mock.h b/subsys/testsuite/ztest/include/ztest_mock.h index 65d535c453c12..8e4ac8fc5152c 100644 --- a/subsys/testsuite/ztest/include/ztest_mock.h +++ b/subsys/testsuite/ztest/include/ztest_mock.h @@ -91,6 +91,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + void z_init_mock(void); int z_cleanup_mock(void); @@ -101,6 +105,10 @@ void z_ztest_check_expected_value(const char *fn, const char *param, void z_ztest_returns_value(const char *fn, uintptr_t value); uintptr_t z_ztest_get_return_value(const char *fn); +#ifdef __cplusplus +} +#endif + #else /* !CONFIG_ZTEST_MOCKING */ #define z_init_mock() diff --git a/subsys/testsuite/ztest/include/ztest_test.h b/subsys/testsuite/ztest/include/ztest_test.h index 857983d9053ff..02e18adc5804c 100644 --- a/subsys/testsuite/ztest/include/ztest_test.h +++ b/subsys/testsuite/ztest/include/ztest_test.h @@ -15,6 +15,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + struct unit_test { const char *name; void (*test)(void); @@ -171,4 +175,8 @@ extern struct k_mem_domain ztest_mem_domain; * @} */ +#ifdef __cplusplus +} +#endif + #endif /* __ZTEST_ASSERT_H__ */