You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by da...@apache.org on 2021/04/19 11:45:16 UTC

[incubator-nuttx] 04/05: execinfo: include-able from C++ files

This is an automated email from the ASF dual-hosted git repository.

davids5 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit d5753125dbd11c3e4604440ee31ff5bd28ce71ac
Author: chao.an <an...@xiaomi.com>
AuthorDate: Mon Apr 12 11:05:11 2021 +0800

    execinfo: include-able from C++ files
    
    Signed-off-by: chao.an <an...@xiaomi.com>
---
 include/execinfo.h | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/include/execinfo.h b/include/execinfo.h
index 5fa5b35..9907184 100644
--- a/include/execinfo.h
+++ b/include/execinfo.h
@@ -25,6 +25,15 @@
  * Public Function Prototypes
  ****************************************************************************/
 
+#undef EXTERN
+#if defined(__cplusplus)
+#define EXTERN extern "C"
+extern "C"
+{
+#else
+#define EXTERN extern
+#endif
+
 #if defined(CONFIG_EABI_UNWINDER)
 
 /* Store up to SIZE return address of the current program state in
@@ -37,4 +46,9 @@ extern void dump_stack(void);
 # define dump_stack()
 #endif
 
+#undef EXTERN
+#if defined(__cplusplus)
+}
+#endif
+
 #endif /* __INCLUDE_EXECINFO_H */