posixjmp.h 1.2 KB

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