Files
wasmtime/crates/runtime/src/helpers.c
Alex Crichton 962f057c8a Remove no-longer-needed C shims (#1686)
The published version of `libc` now has all that's necessary to natively
read these fields!
2020-05-12 16:01:13 -05:00

20 lines
311 B
C

#include <setjmp.h>
int RegisterSetjmp(
void **buf_storage,
void (*body)(void*),
void *payload) {
jmp_buf buf;
if (setjmp(buf) != 0) {
return 0;
}
*buf_storage = &buf;
body(payload);
return 1;
}
void Unwind(void *JmpBuf) {
jmp_buf *buf = (jmp_buf*) JmpBuf;
longjmp(*buf, 1);
}