path: root/mcon/U/d_sigsetjmp.U
diff options
Diffstat (limited to 'mcon/U/d_sigsetjmp.U')
1 files changed, 105 insertions, 0 deletions
diff --git a/mcon/U/d_sigsetjmp.U b/mcon/U/d_sigsetjmp.U
new file mode 100644
index 0000000..b110a44
--- /dev/null
+++ b/mcon/U/d_sigsetjmp.U
@@ -0,0 +1,105 @@
+?RCS: $Id: d_sigsetjmp.U,v 1997/02/28 15:44:33 ram Exp $
+?RCS: Copyright (c) 1996, Andy Dougherty
+?RCS: Copyright (c) 1991-1993, Raphael Manfredi
+?RCS: You may redistribute only under the terms of the Artistic Licence,
+?RCS: as specified in the README file that comes with the distribution.
+?RCS: You may reuse parts of this distribution only within the terms of
+?RCS: that same Artistic Licence; a copy of which may be found at the root
+?RCS: of the source tree for dist 3.0.
+?RCS: You may distribute under the terms of either the GNU General Public
+?RCS: License or the Artistic License, as specified in the README file.
+?RCS: $Log: d_sigsetjmp.U,v $
+?RCS: Revision 1997/02/28 15:44:33 ram
+?RCS: patch61: created
+?MAKE:d_sigsetjmp: Setvar cat +cc +ccflags +ldflags libs rm
+?MAKE: -pick add $@ %<
+?S: This variable conditionally defines the HAS_SIGSETJMP symbol,
+?S: which indicates that the sigsetjmp() routine is available to
+?S: call setjmp() and optionally save the process's signal mask.
+?C: This variable indicates to the C program that the sigsetjmp()
+?C: routine is available to save the calling process's registers
+?C: and stack environment for later use by siglongjmp(), and
+?C: to optionally save the process's signal mask. See
+?C: Sigjmp_buf, Sigsetjmp, and Siglongjmp.
+?C: This is the buffer type to be used with Sigsetjmp and Siglongjmp.
+?C: This macro is used in the same way as sigsetjmp(), but will invoke
+?C: traditional setjmp() if sigsetjmp isn't available.
+?C: This macro is used in the same way as siglongjmp(), but will invoke
+?C: traditional longjmp() if siglongjmp isn't available.
+?H:?%<:#$d_sigsetjmp HAS_SIGSETJMP /**/
+?H:?%<:#ifdef HAS_SIGSETJMP
+?H:?%<:#define Sigjmp_buf sigjmp_buf
+?H:?%<:#define Sigsetjmp(buf,save_mask) sigsetjmp((buf),(save_mask))
+?H:?%<:#define Siglongjmp(buf,retval) siglongjmp((buf),(retval))
+?H:?%<:#define Sigjmp_buf jmp_buf
+?H:?%<:#define Sigsetjmp(buf,save_mask) setjmp((buf))
+?H:?%<:#define Siglongjmp(buf,retval) longjmp((buf),(retval))
+?W:%<:Sigjmp_buf Sigsetjmp Siglongjmp
+?LINT:set d_sigsetjmp
+: see if sigsetjmp exists
+?X: We can't check for these symbols with Inlibc because sigsetjmp
+?X: is (sometimes? always?) a macro under GCC
+echo " "
+case "$d_sigsetjmp" in
+ $cat >set.c <<'EOP'
+#include <setjmp.h>
+sigjmp_buf env;
+int set = 1;
+ if (sigsetjmp(env,1))
+ exit(set);
+ set = 0;
+ siglongjmp(env, 1);
+ exit(1);
+ if $cc $ccflags $ldflags -o set set.c $libs > /dev/null 2>&1 ; then
+ if ./set >/dev/null 2>&1; then
+ echo "POSIX sigsetjmp found." >&4
+ val="$define"
+ else
+ $cat >&4 <<EOM
+Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
+I'll ignore them.
+ val="$undef"
+ fi
+ else
+ echo "sigsetjmp not found." >&4
+ val="$undef"
+ fi
+ ;;
+*) val="$d_sigsetjmp"
+ case "$d_sigsetjmp" in
+ $define) echo "POSIX sigsetjmp found." >&4;;
+ $undef) echo "sigsetjmp not found." >&4;;
+ esac
+ ;;
+set d_sigsetjmp
+eval $setvar
+$rm -f set.c set