/* Copyright (c) 1993 Xerox Corporation. All rights reserved. */ /* $Id$ $Date$ */ #ifndef __PCR_setjmp_h #define __PCR_setjmp_h 1 #include /* This is one of the few PCR posix headers than can't just include the corresponding host header, but the setjmp implementation sometimes must be different inside threads. Some compilers (notably old gcc) recognize the identifiers setjmp and longjmp and process them specially, so the usual PCR renaming is not viable. This means the PCR implementation itself is unable to use setjmp/longjmp. */ #if defined(PCR_Arch_SPARC) # define PCR_setjmp_JBLEN 2 # define PCR_setjmp_SIGJBLEN (PCR_setjmp_JBLEN+2) # define PCR_setjmp_jmp_buf_spIndex 0 # define PCR_setjmp_jmp_buf_pcIndex 1 # define PCR_setjmp_sigjmp_buf_maskSavedIndex 2 # define PCR_setjmp_sigjmp_buf_maskIndex 3 #elif defined(PCR_Arch_MIPS) # define PCR_setjmp_JBLEN 28 # define PCR_setjmp_SIGJBLEN PCR_setjmp_JBLEN # define PCR_setjmp_jmp_buf_spIndex 2 # define PCR_setjmp_jmp_buf_pcIndex 3 # define PCR_setjmp_sigjmp_buf_maskSavedIndex 0 # define PCR_setjmp_sigjmp_buf_maskIndex 1 # define PCR_setjmp_sigjmp_buf_v0Index 4 # define PCR_setjmp_sigjmp_buf_s0Index 5 # define PCR_setjmp_sigjmp_buf_s1Index 6 # define PCR_setjmp_sigjmp_buf_s2Index 7 # define PCR_setjmp_sigjmp_buf_s3Index 8 # define PCR_setjmp_sigjmp_buf_s4Index 9 # define PCR_setjmp_sigjmp_buf_s5Index 10 # define PCR_setjmp_sigjmp_buf_s6Index 11 # define PCR_setjmp_sigjmp_buf_s7Index 12 # define PCR_setjmp_sigjmp_buf_s8Index 13 # define PCR_setjmp_sigjmp_buf_f20Index 14 # define PCR_setjmp_sigjmp_buf_f21Index 15 # define PCR_setjmp_sigjmp_buf_f22Index 16 # define PCR_setjmp_sigjmp_buf_f23Index 17 # define PCR_setjmp_sigjmp_buf_f24Index 18 # define PCR_setjmp_sigjmp_buf_f25Index 19 # define PCR_setjmp_sigjmp_buf_f26Index 20 # define PCR_setjmp_sigjmp_buf_f27Index 21 # define PCR_setjmp_sigjmp_buf_f28Index 22 # define PCR_setjmp_sigjmp_buf_f29Index 23 # define PCR_setjmp_sigjmp_buf_f30Index 24 # define PCR_setjmp_sigjmp_buf_f31Index 25 # define PCR_setjmp_sigjmp_buf_fpcsrIndex 26 # define PCR_setjmp_sigjmp_buf_magicIndex 27 #elif defined(PCR_Arch_INTEL) # define PCR_setjmp_JBLEN 12 # define PCR_setjmp_SIGJBLEN (PCR_setjmp_JBLEN+2) #else # error PCR_Host_arch NYI #endif #undef jmp_buf #undef sigjmp_buf #undef setjmp #undef sigsetjmp #undef longjmp #undef siglongjmp typedef long jmp_buf[PCR_setjmp_JBLEN]; #define PCR_jmp_buf jmp_buf typedef long * jmp_buf_ptr; #define PCR_jmp_buf_ptr jmp_buf_ptr typedef long sigjmp_buf[PCR_setjmp_SIGJBLEN]; #define PCR_sigjmp_buf sigjmp_buf typedef long * sigjmp_buf_ptr; #define PCR_sigjmp_buf_ptr sigjmp_buf_ptr extern int setjmp(jmp_buf env); #define PCR_setjmp setjmp extern int PCR__sigsetjmpInit(sigjmp_buf env, int savemask); extern int sigsetjmp(sigjmp_buf env, int savemask); #define sigsetjmp(env,save) (\ PCR__sigsetjmpInit((env),(save)), setjmp(env) ) #define PCR_sigsetjmp sigsetjmp extern void PCR__longjmpInner(PCR_jmp_buf env, int val); extern void longjmp(PCR_jmp_buf env, int val); #define PCR_longjmp longjmp extern void siglongjmp(PCR_sigjmp_buf env, int val); #define PCR_siglongjmp siglongjmp #endif /* !__PCR_setjmp_h */ /* $Log$ */