2021-05-09 23:00:11 +02:00
|
|
|
#ifndef __SETJMP_H__
|
|
|
|
# define __SETJMP_H__
|
2020-09-17 19:27:01 +02:00
|
|
|
|
|
|
|
#include <stddef.h>
|
|
|
|
#include <stdint.h>
|
2021-05-09 16:35:40 +02:00
|
|
|
#include <bits/setjmp.h>
|
2020-09-17 19:27:01 +02:00
|
|
|
|
2021-05-29 09:56:47 +02:00
|
|
|
/* Make jmp_buf an array type. (7.13§2) */
|
2020-09-17 19:27:01 +02:00
|
|
|
typedef struct __jmp_buf jmp_buf[1];
|
|
|
|
|
2021-05-29 09:56:47 +02:00
|
|
|
/* Save the calling environment in __env (not the signal mask), return 0. */
|
2021-05-30 08:59:06 +02:00
|
|
|
__attribute__((returns_twice))
|
2021-05-29 09:56:47 +02:00
|
|
|
extern int setjmp(jmp_buf __env);
|
2020-10-14 11:45:08 +02:00
|
|
|
|
2021-05-16 18:01:55 +02:00
|
|
|
/* Standard requires setjmp to be a macro (7.13§1) */
|
|
|
|
#define setjmp setjmp
|
|
|
|
|
2021-05-29 09:56:47 +02:00
|
|
|
/* Restore the calling environment from __env, return __val to setjmp. */
|
2021-05-30 08:59:06 +02:00
|
|
|
__attribute__((noreturn))
|
2021-05-29 09:56:47 +02:00
|
|
|
extern void longjmp(jmp_buf __env, int __val);
|
2020-09-17 19:27:01 +02:00
|
|
|
|
2021-05-09 23:00:11 +02:00
|
|
|
#endif /*__SETJMP_H__*/
|