* libc/include/machine/setjmp.h (sigsetjmp): Use GCC extension to
evaluate first parameter only once. (siglongjmp): Ditto.
This commit is contained in:
parent
dd801fdabd
commit
5c9b5ac72d
@ -1,3 +1,9 @@
|
||||
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
|
||||
|
@ -236,6 +236,27 @@ typedef int sigjmp_buf[_JBLEN+2];
|
||||
# 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))
|
||||
@ -244,6 +265,8 @@ typedef int sigjmp_buf[_JBLEN+2];
|
||||
sigprocmask (SIG_SETMASK, (sigset_t *) ((env) + _SIGMASK), 0):0),\
|
||||
longjmp (env, val))
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user