setjmp2.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /* Checking macros for setjmp functions.
  2. Copyright (C) 2009-2016 Free Software Foundation, Inc.
  3. This file is part of the GNU C Library.
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Lesser General Public
  6. License as published by the Free Software Foundation; either
  7. version 2.1 of the License, or (at your option) any later version.
  8. The GNU C Library 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 GNU
  11. Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public
  13. License along with the GNU C Library; if not, see
  14. <http://www.gnu.org/licenses/>. */
  15. #ifndef _SETJMP_H
  16. # error "Never include <bits/setjmp2.h> directly; use <setjmp.h> instead."
  17. #endif
  18. /* Variant of the longjmp functions which perform some sanity checking. */
  19. #ifdef __REDIRECT_NTH
  20. extern void __REDIRECT_NTHNL (longjmp,
  21. (struct __jmp_buf_tag __env[1], int __val),
  22. __longjmp_chk) __attribute__ ((__noreturn__));
  23. extern void __REDIRECT_NTHNL (_longjmp,
  24. (struct __jmp_buf_tag __env[1], int __val),
  25. __longjmp_chk) __attribute__ ((__noreturn__));
  26. extern void __REDIRECT_NTHNL (siglongjmp,
  27. (struct __jmp_buf_tag __env[1], int __val),
  28. __longjmp_chk) __attribute__ ((__noreturn__));
  29. #else
  30. extern void __longjmp_chk (struct __jmp_buf_tag __env[1], int __val),
  31. __THROWNL __attribute__ ((__noreturn__));
  32. # define longjmp __longjmp_chk
  33. # define _longjmp __longjmp_chk
  34. # define siglongjmp __longjmp_chk
  35. #endif