setjmp.h 866 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #ifndef _SETJMP_H
  2. #define _SETJMP_H
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. #if __STDC_VERSION__ >= 201112L
  7. #elif defined(__GNUC__)
  8. #define _Noreturn __attribute__((__noreturn__))
  9. #else
  10. #define _Noreturn
  11. #endif
  12. #include <bits/setjmp.h>
  13. #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
  14. || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
  15. || defined(_BSD_SOURCE)
  16. typedef struct {
  17. jmp_buf __jb;
  18. unsigned long __fl;
  19. unsigned long __ss[128/sizeof(long)];
  20. } sigjmp_buf[1];
  21. int sigsetjmp (sigjmp_buf, int);
  22. _Noreturn void siglongjmp (sigjmp_buf, int);
  23. #endif
  24. #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
  25. || defined(_BSD_SOURCE)
  26. int _setjmp (jmp_buf);
  27. _Noreturn void _longjmp (jmp_buf, int);
  28. #endif
  29. int setjmp (jmp_buf);
  30. _Noreturn void longjmp (jmp_buf, int);
  31. #define setjmp setjmp
  32. #define longjmp longjmp
  33. #ifdef __cplusplus
  34. }
  35. #endif
  36. #endif