blob: 2d43abf84f54ad9fc9501e0204816579c9b0de99 [file] [log] [blame]
Rich Felker0b44a032011-02-12 00:22:29 -05001#ifndef _SETJMP_H
2#define _SETJMP_H
3
4#ifdef __cplusplus
5extern "C" {
6#endif
7
Rich Felkerc1a96582012-09-07 23:13:55 -04008#include <features.h>
Rich Felkerc8ea9852012-09-06 23:12:27 -04009
Rich Felker0b44a032011-02-12 00:22:29 -050010#include <bits/setjmp.h>
Rich Felker0b44a032011-02-12 00:22:29 -050011
Rich Felker96935012013-07-24 02:17:02 -040012typedef struct __jmp_buf_tag {
13 __jmp_buf __jb;
14 unsigned long __fl;
15 unsigned long __ss[128/sizeof(long)];
16} jmp_buf[1];
Rich Felker74eea622011-02-14 18:41:25 -050017
18#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
Rich Felker419ae6d2012-05-22 21:52:08 -040019 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
20 || defined(_BSD_SOURCE)
Rich Felker96935012013-07-24 02:17:02 -040021typedef jmp_buf sigjmp_buf;
Rich Felker74eea622011-02-14 18:41:25 -050022int sigsetjmp (sigjmp_buf, int);
Rich Felker0c05bd32012-09-06 23:34:10 -040023_Noreturn void siglongjmp (sigjmp_buf, int);
Rich Felker74eea622011-02-14 18:41:25 -050024#endif
25
Rich Felker419ae6d2012-05-22 21:52:08 -040026#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
27 || defined(_BSD_SOURCE)
Rich Felker74eea622011-02-14 18:41:25 -050028int _setjmp (jmp_buf);
Rich Felker0c05bd32012-09-06 23:34:10 -040029_Noreturn void _longjmp (jmp_buf, int);
Rich Felker74eea622011-02-14 18:41:25 -050030#endif
31
Rich Felker0b44a032011-02-12 00:22:29 -050032int setjmp (jmp_buf);
Rich Felkerc8ea9852012-09-06 23:12:27 -040033_Noreturn void longjmp (jmp_buf, int);
Rich Felker0b44a032011-02-12 00:22:29 -050034
35#define setjmp setjmp
Rich Felker0b44a032011-02-12 00:22:29 -050036
37#ifdef __cplusplus
38}
39#endif
40
41#endif