From 7c96ab0b434ea7d1f998841f39a5a704b84a87d2 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Tue, 21 Jul 2015 17:31:02 +0200 Subject: Cygwin: Implement siglongjmp and sigsetjmp functions. * libc/include/machine/setjmp.h (siglongjmp): Declare as function on Cygwin. (sigsetjmp): Ditto. (_longjmp): Mark as noreturn function on Cygwin. * common.din (siglongjmp): Export. (sigsetjmp): Export. * gendef: Change formatting of some comments. (sigsetjmp): Implement. (siglongjmp): Implement. (__setjmpex): x86_64 only: Drop entry point. (setjmp): x86_64 only: Store tls stackptr in Frame now, store MXCSR and FPUCW registers in Spare, as MSVCRT does. (longjmp): x86_64 only: Restore tls stackptr from Frame now, restore MXCSR and FPUCW registers from Spare. * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. * new-features.xml (ov-new2.2): Document sigsetjmp, siglongjmp. Signed-off-by: Corinna Vinschen --- newlib/libc/include/machine/setjmp.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'newlib/libc') diff --git a/newlib/libc/include/machine/setjmp.h b/newlib/libc/include/machine/setjmp.h index ec6644a7f..b25684dd5 100644 --- a/newlib/libc/include/machine/setjmp.h +++ b/newlib/libc/include/machine/setjmp.h @@ -381,6 +381,13 @@ typedef int sigjmp_buf[_JBLEN+1+(sizeof (sigset_t)/sizeof (int))]; #define __SIGMASK_FUNC sigprocmask #endif +#ifdef __CYGWIN__ +/* Per POSIX, siglongjmp has to be implemented as function. Cygwin + provides functions for both, siglongjmp and sigsetjmp since 2.2.0. */ +extern void siglongjmp (sigjmp_buf, int) __attribute__ ((__noreturn__)); +extern int sigsetjmp (sigjmp_buf, int); +#endif + #if defined(__GNUC__) #define sigsetjmp(env, savemask) \ @@ -418,8 +425,8 @@ typedef int sigjmp_buf[_JBLEN+1+(sizeof (sigset_t)/sizeof (int))]; are equivalent to sigsetjmp/siglongjmp when not saving the signal mask. New applications should use sigsetjmp/siglongjmp instead. */ #ifdef __CYGWIN__ -extern void _longjmp(jmp_buf, int); -extern int _setjmp(jmp_buf); +extern void _longjmp (jmp_buf, int) __attribute__ ((__noreturn__)); +extern int _setjmp (jmp_buf); #else #define _setjmp(env) sigsetjmp ((env), 0) #define _longjmp(env, val) siglongjmp ((env), (val)) -- cgit v1.2.3