From 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 Mon Sep 17 00:00:00 2001 From: Joe Hunkeler Date: Tue, 11 Aug 2015 16:51:37 -0400 Subject: Repatch (from linux) of OSX IRAF --- 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