setjmp.h raw

   1  #ifndef	_SETJMP_H
   2  #define	_SETJMP_H
   3  
   4  #ifdef __cplusplus
   5  extern "C" {
   6  #endif
   7  
   8  #include <features.h>
   9  
  10  #include <bits/setjmp.h>
  11  
  12  typedef struct __jmp_buf_tag {
  13  	__jmp_buf __jb;
  14  	unsigned long __fl;
  15  	unsigned long __ss[128/sizeof(long)];
  16  } jmp_buf[1];
  17  
  18  #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)
  19  #define __setjmp_attr __attribute__((__returns_twice__))
  20  #else
  21  #define __setjmp_attr
  22  #endif
  23  
  24  #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
  25   || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
  26   || defined(_BSD_SOURCE)
  27  typedef jmp_buf sigjmp_buf;
  28  int sigsetjmp (sigjmp_buf, int) __setjmp_attr;
  29  _Noreturn void siglongjmp (sigjmp_buf, int);
  30  #endif
  31  
  32  #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
  33   || defined(_BSD_SOURCE)
  34  int _setjmp (jmp_buf) __setjmp_attr;
  35  _Noreturn void _longjmp (jmp_buf, int);
  36  #endif
  37  
  38  int setjmp (jmp_buf) __setjmp_attr;
  39  _Noreturn void longjmp (jmp_buf, int);
  40  
  41  #define setjmp setjmp
  42  
  43  #undef __setjmp_attr
  44  
  45  #ifdef __cplusplus
  46  }
  47  #endif
  48  
  49  #endif
  50