aboutsummaryrefslogtreecommitdiff
path: root/unix/hlib/libc/setjmp.h
diff options
context:
space:
mode:
authorJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
committerJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
commit40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch)
tree4464880c571602d54f6ae114729bf62a89518057 /unix/hlib/libc/setjmp.h
downloadiraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'unix/hlib/libc/setjmp.h')
-rw-r--r--unix/hlib/libc/setjmp.h25
1 files changed, 25 insertions, 0 deletions
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