This is the mail archive of the mailing list for the newlib project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch/rfa]: Add _setjmp/_longjmp macros


SUSv3 defines a _setjmp/_longjmp pair of functions, which are equivalent
to setjmp/longjmp, except that they shall never manipulate the signal

The below patch adds _setjmp and _longjmp as macros calling

Ok to apply?


	* libc/include/machine/setjmp.h (_setjmp): Define as macro.
	(_longjmp): Ditto.

Index: libc/include/machine/setjmp.h
RCS file: /cvs/src/src/newlib/libc/include/machine/setjmp.h,v
retrieving revision 1.34
diff -u -p -r1.34 setjmp.h
--- libc/include/machine/setjmp.h	7 Nov 2007 21:42:24 -0000	1.34
+++ libc/include/machine/setjmp.h	13 Jan 2008 16:32:35 -0000
@@ -301,6 +301,12 @@ typedef int sigjmp_buf[_JBLEN+2];
+/* POSIX _setjmp/_longjmp macros, maintained for XSI compatibility.  These
+   are equivalent to sigsetjmp/siglongjmp when not saving the signal mask.
+   New applications should use sigsetjmp/siglongjmp instead. */
+#define _setjmp(env)		sigsetjmp ((env), 0)
+#define _longjmp(env, val)	siglongjmp ((env), (val))
 #ifdef __cplusplus

Corinna Vinschen
Cygwin Project Co-Leader
Red Hat

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]