diff options
-rw-r--r-- | include/setjmp.h | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/include/setjmp.h b/include/setjmp.h index 8ac1443..c261c87 100644 --- a/include/setjmp.h +++ b/include/setjmp.h @@ -46,7 +46,7 @@ #endif #if defined(i386) || defined(__i386__) -#define _JBLEN 10 +#define _JBLEN 8 #endif #if defined(mips) || defined(__mips__) @@ -65,32 +65,34 @@ #define _JBLEN 10 #endif -#ifndef _ANSI_SOURCE /* - * WARNING: sigsetjmp() isn't supported yet, this is a placeholder. + * jmp_buf and sigjmp_buf are encapsulated in different structs to force + * compile-time diagnostics for mismatches. The structs are the same + * internally to avoid some run-time errors for mismatches. */ -typedef int sigjmp_buf[_JBLEN + 1]; +#ifndef _ANSI_SOURCE +typedef struct { int _sjb[_JBLEN + 1]; } sigjmp_buf[1]; #endif /* not ANSI */ -typedef int jmp_buf[_JBLEN]; +typedef struct { int _jb[_JBLEN + 1]; } jmp_buf[1]; #include <sys/cdefs.h> __BEGIN_DECLS int setjmp __P((jmp_buf)); -void longjmp __P((jmp_buf, int)); +__dead +void longjmp __P((jmp_buf, int)) __dead2; #ifndef _ANSI_SOURCE -/* - * WARNING: sigsetjmp() isn't supported yet, this is a placeholder. - */ int sigsetjmp __P((sigjmp_buf, int)); -void siglongjmp __P((sigjmp_buf, int)); +__dead +void siglongjmp __P((sigjmp_buf, int)) __dead2; #endif /* not ANSI */ #if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE) int _setjmp __P((jmp_buf)); -void _longjmp __P((jmp_buf, int)); +__dead +void _longjmp __P((jmp_buf, int)) __dead2; void longjmperror __P((void)); #endif /* neither ANSI nor POSIX */ __END_DECLS |