diff options
Diffstat (limited to 'setjmp/setjmp.h')
-rw-r--r-- | setjmp/setjmp.h | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/setjmp/setjmp.h b/setjmp/setjmp.h index 99e3dc8cd0..f0babc047b 100644 --- a/setjmp/setjmp.h +++ b/setjmp/setjmp.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-1999, 2001 Free Software Foundation, Inc. +/* Copyright (C) 1991-1999, 2001, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -30,6 +30,8 @@ __BEGIN_DECLS #include <bits/setjmp.h> /* Get `__jmp_buf'. */ #include <bits/sigset.h> /* Get `__sigset_t'. */ +__BEGIN_NAMESPACE_STD + /* Calling environment, plus possibly a saved signal mask. */ typedef struct __jmp_buf_tag /* C++ doesn't like tagless structs. */ { @@ -47,16 +49,19 @@ typedef struct __jmp_buf_tag /* C++ doesn't like tagless structs. */ Return 0. */ extern int setjmp (jmp_buf __env) __THROW; -/* Store the calling environment in ENV, not saving the signal mask. - Return 0. */ -extern int _setjmp (jmp_buf __env) __THROW; +__END_NAMESPACE_STD +__USING_NAMESPACE_STD(__jmp_buf_tag) /* Store the calling environment in ENV, also saving the signal mask if SAVEMASK is nonzero. Return 0. This is the internal name for `sigsetjmp'. */ -extern int __sigsetjmp (jmp_buf __env, int __savemask) __THROW; +extern int __sigsetjmp (struct __jmp_buf_tag __env[1], int __savemask) __THROW; #ifndef __FAVOR_BSD +/* Store the calling environment in ENV, not saving the signal mask. + Return 0. */ +extern int _setjmp (struct __jmp_buf_tag __env[1]) __THROW; + /* Do not save the signal mask. This is equivalent to the `_setjmp' BSD function. */ # define setjmp(env) _setjmp (env) @@ -68,15 +73,20 @@ extern int __sigsetjmp (jmp_buf __env, int __savemask) __THROW; #endif /* Favor BSD. */ +__BEGIN_NAMESPACE_STD + /* Jump to the environment saved in ENV, making the `setjmp' call there return VAL, or 1 if VAL is 0. */ -extern void longjmp (jmp_buf __env, int __val) +extern void longjmp (struct __jmp_buf_tag __env[1], int __val) __THROW __attribute__ ((__noreturn__)); + +__END_NAMESPACE_STD + #if defined __USE_BSD || defined __USE_XOPEN /* Same. Usually `_longjmp' is used with `_setjmp', which does not save the signal mask. But it is how ENV was saved that determines whether `longjmp' restores the mask; `_longjmp' is just an alias. */ -extern void _longjmp (jmp_buf __env, int __val) +extern void _longjmp (struct __jmp_buf_tag __env[1], int __val) __THROW __attribute__ ((__noreturn__)); #endif @@ -85,7 +95,7 @@ extern void _longjmp (jmp_buf __env, int __val) /* Use the same type for `jmp_buf' and `sigjmp_buf'. The `__mask_was_saved' flag determines whether or not `longjmp' will restore the signal mask. */ -typedef jmp_buf sigjmp_buf; +typedef struct __jmp_buf_tag sigjmp_buf[1]; /* Store the calling environment in ENV, also saving the signal mask if SAVEMASK is nonzero. Return 0. */ |