summaryrefslogtreecommitdiffstats
path: root/libc-top-half/musl/include/setjmp.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-26 16:08:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-26 16:08:03 +0000
commitf1db79e6e5c383cf76f3bf0dd42115d19591a72b (patch)
tree3f9509008e8a130c45b7e31b1520d66d720493ec /libc-top-half/musl/include/setjmp.h
parentAdding upstream version 0.0~git20230821.ec4566b. (diff)
downloadwasi-libc-upstream.tar.xz
wasi-libc-upstream.zip
Adding upstream version 0.0~git20240411.9e8c542.upstream/0.0_git20240411.9e8c542upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'libc-top-half/musl/include/setjmp.h')
-rw-r--r--libc-top-half/musl/include/setjmp.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/libc-top-half/musl/include/setjmp.h b/libc-top-half/musl/include/setjmp.h
index f505f8e..b57999e 100644
--- a/libc-top-half/musl/include/setjmp.h
+++ b/libc-top-half/musl/include/setjmp.h
@@ -7,7 +7,12 @@ extern "C" {
#include <features.h>
-#ifdef __wasilibc_unmodified_upstream /* WASI has no setjmp */
+#ifndef __wasilibc_unmodified_upstream
+/* WASI has no setjmp */
+#if !defined(__wasm_exception_handling__)
+#error Setjmp/longjmp support requires Exception handling support, which is [not yet standardized](https://github.com/WebAssembly/proposals?tab=readme-ov-file#phase-3---implementation-phase-cg--wg). To enable it, compile with `-mllvm -wasm-enable-sjlj` and use an engine that implements the Exception handling proposal.
+#endif
+#endif
#include <bits/setjmp.h>
typedef struct __jmp_buf_tag {
@@ -40,9 +45,6 @@ int setjmp (jmp_buf) __setjmp_attr;
_Noreturn void longjmp (jmp_buf, int);
#define setjmp setjmp
-#else
-#warning setjmp is not yet implemented for WASI
-#endif
#undef __setjmp_attr