+2005-03-18 Corinna Vinschen <corinna@vinschen.de>
+
+ * libc/include/machine/setjmp.h (sigsetjmp): Use GCC extension to
+ evaluate first parameter only once.
+ (siglongjmp): Ditto.
+
2005-03-17 Jeff Johnston <jjohnstn@redhat.com>
* configure.in: Add new check to see if compiler supports
# define _CYGWIN_WORKING_SIGSETJMP
#endif
+#if defined(__GNUC__)
+
+#define sigsetjmp(env, savemask) \
+ ({ \
+ sigjmp_buf *_sjbuf = &(env); \
+ ((*_sjbuf)[_SAVEMASK] = savemask,\
+ sigprocmask (SIG_SETMASK, 0, (sigset_t *)((*_sjbuf) + _SIGMASK)),\
+ setjmp (*_sjbuf)); \
+ })
+
+#define siglongjmp(env, val) \
+ ({ \
+ sigjmp_buf *_sjbuf = &(env); \
+ ((((*_sjbuf)[_SAVEMASK]) ? \
+ sigprocmask (SIG_SETMASK, (sigset_t *)((*_sjbuf) + _SIGMASK), 0)\
+ : 0), \
+ longjmp (*_sjbuf, val)); \
+ })
+
+#else /* !__GNUC__ */
+
#define sigsetjmp(env, savemask) ((env)[_SAVEMASK] = savemask,\
sigprocmask (SIG_SETMASK, 0, (sigset_t *) ((env) + _SIGMASK)),\
setjmp (env))
sigprocmask (SIG_SETMASK, (sigset_t *) ((env) + _SIGMASK), 0):0),\
longjmp (env, val))
+#endif
+
#ifdef __cplusplus
}
#endif