From fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 8 Jul 2015 20:46:52 -0400 Subject: Initial commit --- unix/hlib/libc/setjmp.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 unix/hlib/libc/setjmp.h (limited to 'unix/hlib/libc/setjmp.h') diff --git a/unix/hlib/libc/setjmp.h b/unix/hlib/libc/setjmp.h new file mode 100644 index 00000000..a92d6b47 --- /dev/null +++ b/unix/hlib/libc/setjmp.h @@ -0,0 +1,25 @@ +/* SETJMP, LONGJMP -- Non local goto. Requires libc.h and knames.h. + * Note that jmp_buf must be at least one int larger than necessary to + */ +#ifndef D_libc +#ifndef import_libc +#include "libc.h" +#endif +#ifndef import_knames +#include "knames.h" +#endif +#endif + +typedef int jmp_buf[LEN_JUMPBUF]; +static int u_jmpstat; + +#define setjmp(e) (ZSVJMP((e),&u_jmpstat),u_jmpstat) +#define longjmp(e,v) (u_jmpstat=(v),ZDOJMP((e),&u_jmpstat)) + +/* The following is necessary to prevent to prevent the optimizer from + * doing unwise things with setjmp on a Sun-4. + */ +extern int zsvjmp_(); +#pragma unknown_control_flow(zsvjmp_) + +#define D_setjmp -- cgit