Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 1 | #ifndef _SETJMP_H |
2 | #define _SETJMP_H | ||||
3 | |||||
4 | #ifdef __cplusplus | ||||
5 | extern "C" { | ||||
6 | #endif | ||||
7 | |||||
Rich Felker | c1a9658 | 2012-09-07 23:13:55 -0400 | [diff] [blame] | 8 | #include <features.h> |
Rich Felker | c8ea985 | 2012-09-06 23:12:27 -0400 | [diff] [blame] | 9 | |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 10 | #include <bits/setjmp.h> |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 11 | |
Rich Felker | 74eea62 | 2011-02-14 18:41:25 -0500 | [diff] [blame] | 12 | |
13 | #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ | ||||
Rich Felker | 419ae6d | 2012-05-22 21:52:08 -0400 | [diff] [blame] | 14 | || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \ |
15 | || defined(_BSD_SOURCE) | ||||
Rich Felker | d6c0efe | 2012-07-03 20:07:33 -0400 | [diff] [blame] | 16 | typedef struct { |
17 | jmp_buf __jb; | ||||
18 | unsigned long __fl; | ||||
Rich Felker | d646249 | 2012-07-22 18:58:35 -0400 | [diff] [blame] | 19 | unsigned long __ss[128/sizeof(long)]; |
Rich Felker | d6c0efe | 2012-07-03 20:07:33 -0400 | [diff] [blame] | 20 | } sigjmp_buf[1]; |
Rich Felker | 74eea62 | 2011-02-14 18:41:25 -0500 | [diff] [blame] | 21 | int sigsetjmp (sigjmp_buf, int); |
Rich Felker | 0c05bd3 | 2012-09-06 23:34:10 -0400 | [diff] [blame] | 22 | _Noreturn void siglongjmp (sigjmp_buf, int); |
Rich Felker | 74eea62 | 2011-02-14 18:41:25 -0500 | [diff] [blame] | 23 | #endif |
24 | |||||
25 | |||||
Rich Felker | 419ae6d | 2012-05-22 21:52:08 -0400 | [diff] [blame] | 26 | #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \ |
27 | || defined(_BSD_SOURCE) | ||||
Rich Felker | 74eea62 | 2011-02-14 18:41:25 -0500 | [diff] [blame] | 28 | int _setjmp (jmp_buf); |
Rich Felker | 0c05bd3 | 2012-09-06 23:34:10 -0400 | [diff] [blame] | 29 | _Noreturn void _longjmp (jmp_buf, int); |
Rich Felker | 74eea62 | 2011-02-14 18:41:25 -0500 | [diff] [blame] | 30 | #endif |
31 | |||||
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 32 | |
33 | int setjmp (jmp_buf); | ||||
Rich Felker | c8ea985 | 2012-09-06 23:12:27 -0400 | [diff] [blame] | 34 | _Noreturn void longjmp (jmp_buf, int); |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 35 | |
36 | #define setjmp setjmp | ||||
37 | #define longjmp longjmp | ||||
38 | |||||
39 | #ifdef __cplusplus | ||||
40 | } | ||||
41 | #endif | ||||
42 | |||||
43 | #endif |