rust/tests/run-make/longjmp-across-rust/foo.c

19 lines
231 B
C

#include <assert.h>
#include <setjmp.h>
static jmp_buf ENV;
extern void test_middle();
void test_start(void(*f)()) {
if (setjmp(ENV) != 0)
return;
f();
assert(0);
}
void test_end() {
longjmp(ENV, 1);
assert(0);
}