]> git.proxmox.com Git - wasi-libc.git/blame - libc-top-half/musl/include/setjmp.h
Say "wasm32-wasi" rather than "wasm32-unknown-wasi".
[wasi-libc.git] / libc-top-half / musl / include / setjmp.h
CommitLineData
320054e8
DG
1#ifndef _SETJMP_H
2#define _SETJMP_H
3
4#ifdef __cplusplus
5extern "C" {
6#endif
7
8#include <features.h>
9
e5f14be3 10#ifdef __wasilibc_unmodified_upstream /* WASI has no setjmp */
320054e8
DG
11#include <bits/setjmp.h>
12
13typedef struct __jmp_buf_tag {
14 __jmp_buf __jb;
15 unsigned long __fl;
16 unsigned long __ss[128/sizeof(long)];
17} jmp_buf[1];
18
19#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
20 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
21 || defined(_BSD_SOURCE)
22typedef jmp_buf sigjmp_buf;
23int sigsetjmp (sigjmp_buf, int);
24_Noreturn void siglongjmp (sigjmp_buf, int);
25#endif
26
27#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
28 || defined(_BSD_SOURCE)
29int _setjmp (jmp_buf);
30_Noreturn void _longjmp (jmp_buf, int);
31#endif
32
33int setjmp (jmp_buf);
34_Noreturn void longjmp (jmp_buf, int);
35
36#define setjmp setjmp
37#else
9f103c28 38#warning setjmp is not yet implemented for WASI
320054e8
DG
39#endif
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif