126497Sache/* posixjmp.h -- wrapper for setjmp.h with changes for POSIX systems. */
226497Sache
358310Sache/* Copyright (C) 1987,1991 Free Software Foundation, Inc.
458310Sache
558310Sache   This file is part of GNU Bash, the Bourne Again SHell.
658310Sache
758310Sache   Bash is free software; you can redistribute it and/or modify it
858310Sache   under the terms of the GNU General Public License as published by
958310Sache   the Free Software Foundation; either version 2, or (at your option)
1058310Sache   any later version.
1158310Sache
1258310Sache   Bash is distributed in the hope that it will be useful, but WITHOUT
1358310Sache   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
1458310Sache   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
1558310Sache   License for more details.
1658310Sache
1758310Sache   You should have received a copy of the GNU General Public License
1858310Sache   along with Bash; see the file COPYING.  If not, write to the Free
1958310Sache   Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
2058310Sache
2126497Sache#ifndef _POSIXJMP_H_
2226497Sache#define _POSIXJMP_H_
2326497Sache
2426497Sache#include <setjmp.h>
2526497Sache
2626497Sache/* This *must* be included *after* config.h */
2726497Sache
2826497Sache#if defined (HAVE_POSIX_SIGSETJMP)
2926497Sache#  define procenv_t	sigjmp_buf
3047558Sache#  if !defined (__OPENNT)
3147558Sache#    undef setjmp
3247558Sache#    define setjmp(x)	sigsetjmp((x), 1)
3347558Sache#    undef longjmp
3447558Sache#    define longjmp(x, n)	siglongjmp((x), (n))
3547558Sache#  endif /* !__OPENNT */
3626497Sache#else
3726497Sache#  define procenv_t	jmp_buf
3826497Sache#endif
3926497Sache
4026497Sache#endif /* _POSIXJMP_H_ */
41