Annotation of mstools/posix/h/setjmp.h, revision 1.1.1.2

1.1       root        1: /***
                      2: *setjmp.h - definitions/declarations for setjmp/longjmp routines
                      3: *
                      4: *       Copyright (c) 1985-1992, Microsoft Corporation. All rights reserved.
                      5: *
                      6: *Purpose:
                      7: *       This file defines the machine-dependent buffer used by
                      8: *       setjmp/longjmp to save and restore the program state, and
                      9: *       declarations for those routines.
                     10: *       [ANSI/System V]
                     11: *
1.1.1.2 ! root       12: *      The setjmp() that will be used by those who include this file
        !            13: *      is _setjmpex, which is safe for use with try/except/finally,
        !            14: *      but is slow.  See <crt/setjmpex.h> and <crt/setjmp.h> for more.
        !            15: *
1.1       root       16: ****/
                     17: 
                     18: #ifndef _INC_SETJMP
                     19: 
1.1.1.2 ! root       20: #include <signal.h>
        !            21: 
1.1       root       22: #ifndef __cplusplus
                     23: 
                     24: 
                     25: /*
                     26:  * Conditional macro definition for function calling type and variable type
                     27:  * qualifiers.
                     28:  */
                     29: #if   ( (_MSC_VER >= 800) && (_M_IX86 >= 300) )
                     30: 
                     31: /*
                     32:  * Definitions for MS C8-32 (386/486) compiler
                     33:  */
                     34: #define _CRTAPI1 __cdecl
                     35: #define _CRTAPI2 __cdecl
                     36: 
                     37: #elif ( _MSC_VER == 600 )
                     38: 
                     39: /*
                     40:  * Definitions for old MS C6-386 compiler
                     41:  */
                     42: #define _CRTAPI1 _cdecl
                     43: #define _CRTAPI2 _cdecl
                     44: #define _M_IX86  300
                     45: 
                     46: #else
                     47: 
                     48: /*
                     49:  * Other compilers (e.g., MIPS)
                     50:  */
                     51: #define _CRTAPI1
                     52: #define _CRTAPI2
                     53: 
                     54: #endif
                     55: 
                     56: /*
1.1.1.2 ! root       57:  * Posix programs use _setjmpex by default.
        !            58:  */
        !            59: 
        !            60: #define setjmp _setjmpex
        !            61: 
        !            62: /*
1.1       root       63:  * Definitions specific to particular setjmp implementations.
                     64:  */
                     65: #ifdef  _M_IX86
                     66: 
                     67: /*
                     68:  * MS C8-32 or older MS C6-386 compilers
                     69:  */
                     70: #define _JBLEN  8
1.1.1.2 ! root       71: #define _JBTYPE int
        !            72: 
        !            73: /*
        !            74:  * Define jump buffer layout for x86 setjmp/longjmp
        !            75:  */
        !            76: 
        !            77: typedef struct __JUMP_BUFFER {
        !            78:        unsigned long Ebp;
        !            79:        unsigned long Ebx;
        !            80:        unsigned long Edi;
        !            81:        unsigned long Esi;
        !            82:        unsigned long Esp;
        !            83:        unsigned long Eip;
        !            84:        unsigned long Registration;
        !            85:        unsigned long TryLevel;
        !            86: } _JUMP_BUFFER;
1.1       root       87: 
                     88: #else
                     89: 
                     90: /*
                     91:  * Assume compiler implements setjmp as a function
                     92:  */
                     93: 
                     94: #define _setjmp setjmp
                     95: 
                     96: #endif
                     97: 
                     98: 
1.1.1.2 ! root       99: #if     ( defined(_M_RX000) || defined(_MIPS_) )
        !           100: /*
        !           101:  * All MIPS implementations need _JBLEN of 16
        !           102:  */
        !           103: #define _JBLEN  16
        !           104: #define _JBTYPE double
        !           105: 
        !           106: /*
        !           107:  * Define jump buffer layout for MIPS setjmp/longjmp.
        !           108:  */
        !           109: 
        !           110: typedef struct __JUMP_BUFFER {
        !           111:        unsigned long FltF20;
        !           112:        unsigned long FltF21;
        !           113:        unsigned long FltF22;
        !           114:        unsigned long FltF23;
        !           115:        unsigned long FltF24;
        !           116:        unsigned long FltF25;
        !           117:        unsigned long FltF26;
        !           118:        unsigned long FltF27;
        !           119:        unsigned long FltF28;
        !           120:        unsigned long FltF29;
        !           121:        unsigned long FltF30;
        !           122:        unsigned long FltF31;
        !           123:        unsigned long IntS0;
        !           124:        unsigned long IntS1;
        !           125:        unsigned long IntS2;
        !           126:        unsigned long IntS3;
        !           127:        unsigned long IntS4;
        !           128:        unsigned long IntS5;
        !           129:        unsigned long IntS6;
        !           130:        unsigned long IntS7;
        !           131:        unsigned long IntS8;
        !           132:        unsigned long Type;
        !           133:        unsigned long Fir;
        !           134: } _JUMP_BUFFER;
        !           135: 
        !           136: #endif
        !           137: 
        !           138: #if defined(_ALPHA_)
        !           139: 
1.1       root      140: /*
1.1.1.2 ! root      141:  * All ALPHA implementations need _JBLEN of 2
1.1       root      142:  */
1.1.1.2 ! root      143: 
        !           144: #define _JBLEN 2
        !           145: #define _JBTYPE double
1.1       root      146: 
                    147: #endif
                    148: 
                    149: /* define the buffer type for holding the state information */
                    150: 
                    151: #ifndef _JMP_BUF_DEFINED
1.1.1.2 ! root      152: typedef  _JBTYPE  jmp_buf[_JBLEN];
1.1       root      153: #define _JMP_BUF_DEFINED
                    154: #endif
                    155: 
                    156: #ifndef _SIGJMP_BUF_DEFINED
                    157: #define _SIGJMP_BUF_DEFINED
                    158: /*
                    159:  * sigjmp buf is just a jmp_buf plus an int to say whether the sigmask
                    160:  * is saved or not, and a sigmask_t for the mask if it is saved.
1.1.1.2 ! root      161:  */
1.1       root      162: 
1.1.1.2 ! root      163: typedef _JBTYPE sigjmp_buf[_JBLEN + 2];
1.1       root      164: #endif /* _SIGJMP_BUF_DEFINED */
                    165: 
1.1.1.2 ! root      166: extern _JBTYPE * _CRTAPI1 _sigjmp_store_mask(sigjmp_buf, int);
        !           167: 
        !           168: #define sigsetjmp(_env, _save)                         \
        !           169:        setjmp(_sigjmp_store_mask((_env), (_save)))
1.1       root      170: 
                    171: /* function prototypes */
                    172: 
                    173: int  _CRTAPI1 setjmp(jmp_buf);
                    174: void _CRTAPI1 longjmp(jmp_buf, int);
                    175: void _CRTAPI1 siglongjmp(sigjmp_buf, int);
                    176: 
                    177: /* function prototypes */
                    178: 
                    179: #endif  /* __cplusplus */
                    180: 
                    181: #define _INC_SETJMP
                    182: #endif  /* _INC_SETJMP */

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.