Define sigsetjmp/siglongjmp only if __POSIX_VISIBLE
Ken Brown
kbrown@cornell.edu
Mon Aug 7 09:36:00 GMT 2017
The attached patch fixes the issue reported here:
https://cygwin.com/ml/cygwin/2017-08/msg00060.html
I'm not sure if I was correct in including RTEMS or if this should have
been Cygwin only. If the former, I probably should have sent this to
the Newlib list.
Ken
-------------- next part --------------
From 45060307b1e8e06a522cd95e9567155e98dda832 Mon Sep 17 00:00:00 2001
From: Ken Brown <kbrown@cornell.edu>
Date: Sun, 6 Aug 2017 17:40:43 -0400
Subject: [PATCH] Define sigsetjmp/siglongjmp only if __POSIX_VISIBLE
---
newlib/libc/include/machine/setjmp.h | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/newlib/libc/include/machine/setjmp.h b/newlib/libc/include/machine/setjmp.h
index 2b4dd8b91..fc5639f3d 100644
--- a/newlib/libc/include/machine/setjmp.h
+++ b/newlib/libc/include/machine/setjmp.h
@@ -368,7 +368,7 @@ typedef int jmp_buf[_JBLEN];
_END_STD_C
-#if defined(__CYGWIN__) || defined(__rtems__)
+#if (defined(__CYGWIN__) || defined(__rtems__)) && __POSIX_VISIBLE
#include <signal.h>
#ifdef __cplusplus
@@ -376,6 +376,8 @@ extern "C" {
#endif
/* POSIX sigsetjmp/siglongjmp macros */
+
+
#ifdef _JBTYPE
typedef _JBTYPE sigjmp_buf[_JBLEN+1+((sizeof (_JBTYPE) + sizeof (sigset_t) - 1)
/sizeof (_JBTYPE))];
@@ -450,4 +452,4 @@ extern int _setjmp (jmp_buf);
#ifdef __cplusplus
}
#endif
-#endif /* __CYGWIN__ or __rtems__ */
+#endif /* (__CYGWIN__ or __rtems__) and __POSIX_VISIBLE */
--
2.13.2
More information about the Cygwin-patches
mailing list