From ce95db46b9f15df25893c9d1c664e1aab8846f6b Mon Sep 17 00:00:00 2001 From: qinwei1 Date: Tue, 15 Nov 2022 00:58:12 +0800 Subject: [PATCH] include/nuttx/tls.h: add CXX extern define for tls Summary: In order to use C functions in C++ code, "extern C" needs to be defined in the C header file. Add "extern C" define for tls.h Signed-off-by: qinwei1 --- include/nuttx/tls.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/include/nuttx/tls.h b/include/nuttx/tls.h index 8d233f8601..3215e89981 100644 --- a/include/nuttx/tls.h +++ b/include/nuttx/tls.h @@ -63,6 +63,14 @@ * Public Types ****************************************************************************/ +#ifdef __cplusplus +#define EXTERN extern "C" +extern "C" +{ +#else +#define EXTERN extern +#endif + /* type tls_ndxset_t & tls_dtor_t *******************************************/ /* Smallest addressable type that can hold the entire configured number of @@ -345,4 +353,9 @@ void tls_destruct(void); FAR struct task_info_s *task_get_info(void); +#undef EXTERN +#ifdef __cplusplus +} +#endif + #endif /* __INCLUDE_NUTTX_TLS_H */