xref: /dflybsd-src/contrib/gdb-7/readline/posixjmp.h (revision 16003dcfd2baa152f5dd24794ec9f36e139eaeb8)
1*6b445a62SJohn Marino /* posixjmp.h -- wrapper for setjmp.h with changes for POSIX systems. */
2*6b445a62SJohn Marino 
3*6b445a62SJohn Marino /* Copyright (C) 1987,1991 Free Software Foundation, Inc.
4*6b445a62SJohn Marino 
5*6b445a62SJohn Marino    This file is part of GNU Bash, the Bourne Again SHell.
6*6b445a62SJohn Marino 
7*6b445a62SJohn Marino    Bash is free software: you can redistribute it and/or modify
8*6b445a62SJohn Marino    it under the terms of the GNU General Public License as published by
9*6b445a62SJohn Marino    the Free Software Foundation, either version 3 of the License, or
10*6b445a62SJohn Marino    (at your option) any later version.
11*6b445a62SJohn Marino 
12*6b445a62SJohn Marino    Bash is distributed in the hope that it will be useful,
13*6b445a62SJohn Marino    but WITHOUT ANY WARRANTY; without even the implied warranty of
14*6b445a62SJohn Marino    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15*6b445a62SJohn Marino    GNU General Public License for more details.
16*6b445a62SJohn Marino 
17*6b445a62SJohn Marino    You should have received a copy of the GNU General Public License
18*6b445a62SJohn Marino    along with Bash.  If not, see <http://www.gnu.org/licenses/>.
19*6b445a62SJohn Marino */
20*6b445a62SJohn Marino 
21*6b445a62SJohn Marino #ifndef _POSIXJMP_H_
22*6b445a62SJohn Marino #define _POSIXJMP_H_
23*6b445a62SJohn Marino 
24*6b445a62SJohn Marino #include <setjmp.h>
25*6b445a62SJohn Marino 
26*6b445a62SJohn Marino /* This *must* be included *after* config.h */
27*6b445a62SJohn Marino 
28*6b445a62SJohn Marino #if defined (HAVE_POSIX_SIGSETJMP)
29*6b445a62SJohn Marino #  define procenv_t	sigjmp_buf
30*6b445a62SJohn Marino #  if !defined (__OPENNT)
31*6b445a62SJohn Marino #    undef setjmp
32*6b445a62SJohn Marino #    define setjmp(x)	sigsetjmp((x), 1)
33*6b445a62SJohn Marino #    undef longjmp
34*6b445a62SJohn Marino #    define longjmp(x, n)	siglongjmp((x), (n))
35*6b445a62SJohn Marino #  endif /* !__OPENNT */
36*6b445a62SJohn Marino #else
37*6b445a62SJohn Marino #  define procenv_t	jmp_buf
38*6b445a62SJohn Marino #endif
39*6b445a62SJohn Marino 
40*6b445a62SJohn Marino #endif /* _POSIXJMP_H_ */
41