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 | 9693501 | 2013-07-24 02:17:02 -0400 | [diff] [blame] | 12 | typedef struct __jmp_buf_tag { |
13 | __jmp_buf __jb; | ||||
14 | unsigned long __fl; | ||||
15 | unsigned long __ss[128/sizeof(long)]; | ||||
16 | } jmp_buf[1]; | ||||
Rich Felker | 74eea62 | 2011-02-14 18:41:25 -0500 | [diff] [blame] | 17 | |
18 | #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ | ||||
Rich Felker | 419ae6d | 2012-05-22 21:52:08 -0400 | [diff] [blame] | 19 | || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \ |
20 | || defined(_BSD_SOURCE) | ||||
Rich Felker | 9693501 | 2013-07-24 02:17:02 -0400 | [diff] [blame] | 21 | typedef jmp_buf sigjmp_buf; |
Rich Felker | 74eea62 | 2011-02-14 18:41:25 -0500 | [diff] [blame] | 22 | int sigsetjmp (sigjmp_buf, int); |
Rich Felker | 0c05bd3 | 2012-09-06 23:34:10 -0400 | [diff] [blame] | 23 | _Noreturn void siglongjmp (sigjmp_buf, int); |
Rich Felker | 74eea62 | 2011-02-14 18:41:25 -0500 | [diff] [blame] | 24 | #endif |
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 | int setjmp (jmp_buf); |
Rich Felker | c8ea985 | 2012-09-06 23:12:27 -0400 | [diff] [blame] | 33 | _Noreturn void longjmp (jmp_buf, int); |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 34 | |
35 | #define setjmp setjmp | ||||
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 36 | |
37 | #ifdef __cplusplus | ||||
38 | } | ||||
39 | #endif | ||||
40 | |||||
41 | #endif |