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]

Re: [patch/rfa]: Add _setjmp/_longjmp macros

On Jan 13 17:32, Corinna Vinschen wrote:
> Hi,
> SUSv3 defines a _setjmp/_longjmp pair of functions, which are equivalent
> to setjmp/longjmp, except that they shall never manipulate the signal
> mask:
> The below patch adds _setjmp and _longjmp as macros calling
> sigsetjmp/siglongjmp.

I applied the below additional patch as obvious.  It defines both
interfaces as functions when building for Cygwin.


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

Index: libc/include/machine/setjmp.h
RCS file: /cvs/src/src/newlib/libc/include/machine/setjmp.h,v
retrieving revision 1.35
diff -u -p -r1.35 setjmp.h
--- libc/include/machine/setjmp.h       15 Jan 2008 09:41:06 -0000      1.35
+++ libc/include/machine/setjmp.h       21 Jun 2008 18:45:53 -0000
@@ -307,11 +307,16 @@ typedef int sigjmp_buf[_JBLEN+2];
-/* POSIX _setjmp/_longjmp macros, maintained for XSI compatibility.  These
+/* POSIX _setjmp/_longjmp, maintained for XSI compatibility.  These
    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);
 #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]