support _BSD_SOURCE feature test macro
[musl] / include / setjmp.h
1 #ifndef _SETJMP_H
2 #define _SETJMP_H
3
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
7
8 #include <bits/setjmp.h>
9
10
11 #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
12  || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
13  || defined(_BSD_SOURCE)
14 typedef unsigned long sigjmp_buf[(128+sizeof(jmp_buf))/sizeof(long)];
15 #ifdef _GNU_SOURCE
16 #define jmp_buf sigjmp_buf
17 #endif
18 int sigsetjmp (sigjmp_buf, int);
19 void siglongjmp (sigjmp_buf, int);
20 #endif
21
22
23 #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
24  || defined(_BSD_SOURCE)
25 int _setjmp (jmp_buf);
26 void _longjmp (jmp_buf, int);
27 #endif
28
29
30 int setjmp (jmp_buf);
31 void longjmp (jmp_buf, int);
32
33 #define setjmp setjmp
34 #define longjmp longjmp
35
36 #ifdef __cplusplus
37 }
38 #endif
39
40 #endif