From a363e882ea57221bf55cfb5d9b179756fc60f9a2 Mon Sep 17 00:00:00 2001 From: Jaroslaw Stelter Date: Mon, 5 Sep 2022 14:39:25 +0200 Subject: [PATCH] zephyr: rtos: Allow memory operations to be called from cpp code The memcpy_s() function is called from CPP code in IADK modules. Declare it as extern "C" when header included in CPP code. Signed-off-by: Jaroslaw Stelter --- zephyr/include/rtos/string.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/zephyr/include/rtos/string.h b/zephyr/include/rtos/string.h index 34fc857ac..eeff889e8 100644 --- a/zephyr/include/rtos/string.h +++ b/zephyr/include/rtos/string.h @@ -11,6 +11,9 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif /* missing from zephyr - TODO: convert to memset() */ #define bzero(ptr, size) \ memset(ptr, 0, size) @@ -60,4 +63,8 @@ static inline int memset_s(void *dest, size_t dest_size, int data, size_t count) return 0; } +#ifdef __cplusplus +} /* extern "C" */ +#endif + #endif /* __ZEPHYR_RTOS_STRING_H__ */