summaryrefslogtreecommitdiff
path: root/setjmp
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1992-06-05 02:23:07 +0000
committerRoland McGrath <roland@gnu.org>1992-06-05 02:23:07 +0000
commitaa24af5c817db563a1a587b591786588cfc989ff (patch)
tree3f747ec4637ab3076aa81f04259c599a82393d9b /setjmp
parentbd9f5c4d71e843165cb07e9aae6c282c0b284799 (diff)
Formerly setjmp/setjmp.h.~12~
Diffstat (limited to 'setjmp')
-rw-r--r--setjmp/setjmp.h21
1 files changed, 13 insertions, 8 deletions
diff --git a/setjmp/setjmp.h b/setjmp/setjmp.h
index 3d4347c86e..702236073d 100644
--- a/setjmp/setjmp.h
+++ b/setjmp/setjmp.h
@@ -58,8 +58,9 @@ typedef struct
extern void __sigjmp_save __P ((sigjmp_buf __env, int __savemask));
#ifdef __GNUC__
#define sigsetjmp(env, savemask) \
- ({ sigjmp_buf *__e = (env); \
- __sigjmp_save (*__e, (savemask)), __setjmp ((*__e)[0].__jmpbuf) })
+ ({ __typeof ((*((sigjmp_buf *) 0))[0]) *__e = (env); \
+ __sigjmp_save (__e, (savemask)); \
+ __setjmp (__e[0].__jmpbuf); })
#else
/* Not strictly POSIX-compliant, because it evaluates ENV more than once. */
#define sigsetjmp(env, savemask) \
@@ -106,16 +107,13 @@ extern int __setjmp __P ((__jmp_buf __env));
#ifdef __USE_BSD
extern __NORETURN void _longjmp __P ((__const jmp_buf __env, int __val));
-#define _setjmp(env) sigsetjmp((env), 0)
-
-#ifdef __OPTIMIZE__
-#define _longjmp(env, val) siglongjmp ((env), (val))
-#endif /* Optimizing. */
#endif /* Use BSD. */
-
#ifdef __FAVOR_BSD
+/* We are in the mode in which `setjmp' and `longjmp' save and restore
+ the signal mask, and `jmp_buf' is `sigjmp_buf'. */
+
#undef setjmp
#undef longjmp
@@ -125,6 +123,13 @@ extern __NORETURN void _longjmp __P ((__const jmp_buf __env, int __val));
#define longjmp(env, val) siglongjmp ((env), (val))
#endif /* Optimizing. */
+#define _setjmp(env) sigsetjmp ((env), 0)
+
+#else /* Don't favor BSD. */
+
+/* `setjmp' and `_setjmp' are the same. */
+#define _setjmp(env) setjmp (env)
+
#endif /* Favor BSD. */