summaryrefslogtreecommitdiff
path: root/jbwrap.h
diff options
context:
space:
mode:
authorToby Goodwin <tjg@star.le.ac.uk>1999-01-11 10:55:18 +0000
committerToby Goodwin <toby@paccrat.org>2015-05-16 21:22:09 +0100
commite11c7df86144bed383ac6bbeaecc3017d18b37db (patch)
tree6fad44921723eab2f2eb1c76b7214b4e79b818f3 /jbwrap.h
parent671e1e2d1599aa8c5f1010b3fe75c151c56a7403 (diff)
beta: rc-1.5b4
Diffstat (limited to 'jbwrap.h')
-rw-r--r--jbwrap.h22
1 files changed, 18 insertions, 4 deletions
diff --git a/jbwrap.h b/jbwrap.h
index 7d0358b..4b3ea86 100644
--- a/jbwrap.h
+++ b/jbwrap.h
@@ -1,9 +1,23 @@
#include <setjmp.h>
-/* certain braindamaged environments don't define jmp_buf as an array, so... */
+/* If we have POSIX sigjmp_buf and friends, use them. If we don't, just
+use a jmp_buf. This probably fails on a traditional SysV machine, where
+jmp_bufs don't preserve signal masks. I'm not worrying about this till
+someone reports it as a bug :-). */
+
+#if HAVE_SIGSETJMP
+#else
+#define sigjmp_buf jmp_buf
+#define sigsetjmp(x,y) setjmp(x)
+#define siglongjmp longjmp
+#endif /* HAVE_SIGSETJMP */
+
+
+/* Certain braindamaged environments don't define jmp_buf as an array,
+so wrap it in a structure. Potentially, we could use configure to do
+this only where it needs to be done, but the effort is probably not
+worth it. */
struct Jbwrap {
- jmp_buf j;
+ sigjmp_buf j;
};
-
-extern Jbwrap slowbuf; /* for getting out of interrupts while performing slow i/o on BSD */