summaryrefslogtreecommitdiff
path: root/mcon/U/d_sigsetjmp.U
diff options
context:
space:
mode:
authorManoj Srivastava <srivasta@debian.org>2008-05-30 12:42:47 -0700
committerManoj Srivastava <srivasta@debian.org>2008-05-30 12:42:47 -0700
commitceb3507a8fca872770b3dcd7e5c5b36179ab95b0 (patch)
treeb46b4e25cfff5f4c13a330b8428ceed343e3796c /mcon/U/d_sigsetjmp.U
Import dist_3.5-236.orig.tar.gz
[dgit import orig dist_3.5-236.orig.tar.gz]
Diffstat (limited to 'mcon/U/d_sigsetjmp.U')
-rw-r--r--mcon/U/d_sigsetjmp.U104
1 files changed, 104 insertions, 0 deletions
diff --git a/mcon/U/d_sigsetjmp.U b/mcon/U/d_sigsetjmp.U
new file mode 100644
index 0000000..99f75e2
--- /dev/null
+++ b/mcon/U/d_sigsetjmp.U
@@ -0,0 +1,104 @@
+?RCS: $Id$
+?RCS:
+?RCS: Copyright (c) 1996, Andy Dougherty
+?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi
+?RCS:
+?RCS: You may redistribute only under the terms of the Artistic License,
+?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 License; a copy of which may be found at the root
+?RCS: of the source tree for dist 4.0.
+?RCS:
+?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:
+?RCS: $Log: d_sigsetjmp.U,v $
+?RCS: Revision 3.0.1.1 1997/02/28 15:44:33 ram
+?RCS: patch61: created
+?RCS:
+?MAKE:d_sigsetjmp: Setvar cat +cc +ccflags +ldflags libs rm
+?MAKE: -pick add $@ %<
+?S:d_sigsetjmp:
+?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.
+?S:.
+?C:HAS_SIGSETJMP:
+?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:.
+?C:Sigjmp_buf:
+?C: This is the buffer type to be used with Sigsetjmp and Siglongjmp.
+?C:.
+?C:Sigsetjmp:
+?C: This macro is used in the same way as sigsetjmp(), but will invoke
+?C: traditional setjmp() if sigsetjmp isn't available.
+?C: See HAS_SIGSETJMP.
+?C:.
+?C:Siglongjmp:
+?C: This macro is used in the same way as siglongjmp(), but will invoke
+?C: traditional longjmp() if siglongjmp isn't available.
+?C: See HAS_SIGSETJMP.
+?C:.
+?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:?%<:#else
+?H:?%<:#define Sigjmp_buf jmp_buf
+?H:?%<:#define Sigsetjmp(buf,save_mask) setjmp((buf))
+?H:?%<:#define Siglongjmp(buf,retval) longjmp((buf),(retval))
+?H:?%<:#endif
+?H:.
+?W:%<:Sigjmp_buf Sigsetjmp Siglongjmp
+?F:!set
+?LINT:set d_sigsetjmp
+: see if sigsetjmp exists
+echo " "
+case "$d_sigsetjmp" in
+'')
+ $cat >set.c <<'EOP'
+#include <setjmp.h>
+sigjmp_buf env;
+int set = 1;
+int main(void)
+{
+ if (sigsetjmp(env,1))
+ return set;
+ set = 0;
+ siglongjmp(env, 1);
+ return 1;
+}
+EOP
+ 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.
+EOM
+ 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
+ ;;
+esac
+set d_sigsetjmp
+eval $setvar
+$rm -f set.c set
+