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