[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Lightning] Fwd: [patch/rfa]: Add _setjmp/_longjmp macros
From: |
Reini Urban |
Subject: |
[Lightning] Fwd: [patch/rfa]: Add _setjmp/_longjmp macros |
Date: |
Sun, 22 Jun 2008 10:21:48 +0200 |
This recent cygwin change will clarify recent discussion.
---------- Forwarded message ----------
From: Corinna Vinschen <address@hidden>
Date: 2008/6/21
Subject: Re: [patch/rfa]: Add _setjmp/_longjmp macros
To: address@hidden
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:
>
> http://www.opengroup.org/onlinepubs/009695399/functions/_setjmp.html
>
> 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.
Corinna
* libc/include/machine/setjmp.h (_longjmp): Define as function on
Cygwin.
(_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];
#endif
-/* 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);
+#else
#define _setjmp(env) sigsetjmp ((env), 0)
#define _longjmp(env, val) siglongjmp ((env), (val))
+#endif
#ifdef __cplusplus
}
--
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat
--
Reini Urban
http://phpwiki.org/ http://murbreak.at/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Lightning] Fwd: [patch/rfa]: Add _setjmp/_longjmp macros,
Reini Urban <=