You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by gu...@apache.org on 2021/07/09 17:06:18 UTC

[incubator-nuttx] branch master updated: arm/setjmp.h:add c++ support

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 95b5dc5  arm/setjmp.h:add c++ support
95b5dc5 is described below

commit 95b5dc523e9765c300e08e69bd14f0d22207f631
Author: guowei15 <gu...@xiaomi.com>
AuthorDate: Wed Feb 24 12:51:40 2021 +0800

    arm/setjmp.h:add c++ support
    
    N/A
    
    Change-Id: I619cc15570adeff10f3a9b69bf9a3cff83e625c1
    Signed-off-by: guowei15 <gu...@xiaomi.com>
---
 arch/arm/include/setjmp.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/arch/arm/include/setjmp.h b/arch/arm/include/setjmp.h
index ab82af1..cf9da6b 100644
--- a/arch/arm/include/setjmp.h
+++ b/arch/arm/include/setjmp.h
@@ -84,7 +84,20 @@ typedef struct setjmp_buf_s jmp_buf[1];
  * Public Function Prototypes
  ****************************************************************************/
 
+#ifdef __cplusplus
+#define EXTERN extern "C"
+extern "C"
+{
+#else
+#define EXTERN extern
+#endif
+
 int setjmp(jmp_buf env);
 void longjmp(jmp_buf env, int val) noreturn_function;
 
+#undef EXTERN
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* __ARCH_ARM_INCLUDE_SETJUMP_H */