blob: abc74234b636c0809dee18fa085231096923c7ee [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 Felker74eea622011-02-14 18:41:25 -050012
13#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
Rich Felker419ae6d2012-05-22 21:52:08 -040014 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
15 || defined(_BSD_SOURCE)
Rich Felkerd6c0efe2012-07-03 20:07:33 -040016typedef struct {
17 jmp_buf __jb;
18 unsigned long __fl;
Rich Felkerd6462492012-07-22 18:58:35 -040019 unsigned long __ss[128/sizeof(long)];
Rich Felkerd6c0efe2012-07-03 20:07:33 -040020} sigjmp_buf[1];
Rich Felker74eea622011-02-14 18:41:25 -050021int sigsetjmp (sigjmp_buf, int);
Rich Felker0c05bd32012-09-06 23:34:10 -040022_Noreturn void siglongjmp (sigjmp_buf, int);
Rich Felker74eea622011-02-14 18:41:25 -050023#endif
24
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 -050032
33int setjmp (jmp_buf);
Rich Felkerc8ea9852012-09-06 23:12:27 -040034_Noreturn void longjmp (jmp_buf, int);
Rich Felker0b44a032011-02-12 00:22:29 -050035
36#define setjmp setjmp
37#define longjmp longjmp
38
39#ifdef __cplusplus
40}
41#endif
42
43#endif