2011-02-12 08:22:29 +03:00
|
|
|
#ifndef _SETJMP_H
|
|
|
|
#define _SETJMP_H
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2012-09-07 07:12:27 +04:00
|
|
|
#if __STDC_VERSION__ >= 201112L
|
|
|
|
#elif defined(__GNUC__)
|
|
|
|
#define _Noreturn __attribute__((__noreturn__))
|
|
|
|
#else
|
|
|
|
#define _Noreturn
|
|
|
|
#endif
|
|
|
|
|
2011-02-12 08:22:29 +03:00
|
|
|
#include <bits/setjmp.h>
|
|
|
|
|
2011-02-15 02:41:25 +03:00
|
|
|
|
|
|
|
#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
|
2012-05-23 05:52:08 +04:00
|
|
|
|| defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
|
|
|
|
|| defined(_BSD_SOURCE)
|
2012-07-04 04:07:33 +04:00
|
|
|
typedef struct {
|
|
|
|
jmp_buf __jb;
|
|
|
|
unsigned long __fl;
|
2012-07-23 02:58:35 +04:00
|
|
|
unsigned long __ss[128/sizeof(long)];
|
2012-07-04 04:07:33 +04:00
|
|
|
} sigjmp_buf[1];
|
2011-02-15 02:41:25 +03:00
|
|
|
int sigsetjmp (sigjmp_buf, int);
|
|
|
|
void siglongjmp (sigjmp_buf, int);
|
|
|
|
#endif
|
2011-02-12 08:22:29 +03:00
|
|
|
|
2011-02-15 02:41:25 +03:00
|
|
|
|
2012-05-23 05:52:08 +04:00
|
|
|
#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
|
|
|
|
|| defined(_BSD_SOURCE)
|
2011-02-12 08:22:29 +03:00
|
|
|
int _setjmp (jmp_buf);
|
2011-02-15 02:41:25 +03:00
|
|
|
void _longjmp (jmp_buf, int);
|
|
|
|
#endif
|
|
|
|
|
2011-02-12 08:22:29 +03:00
|
|
|
|
2011-02-15 02:41:25 +03:00
|
|
|
int setjmp (jmp_buf);
|
2012-09-07 07:12:27 +04:00
|
|
|
_Noreturn void longjmp (jmp_buf, int);
|
2011-02-12 08:22:29 +03:00
|
|
|
|
|
|
|
#define setjmp setjmp
|
|
|
|
#define longjmp longjmp
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|