aboutsummaryrefslogtreecommitdiff
path: root/unix/hlib/libc/setjmp.h
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
commitfa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch)
treebdda434976bc09c864f2e4fa6f16ba1952b1e555 /unix/hlib/libc/setjmp.h
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
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