|
|
1.1 root 1: /***
2: *setjmp.h - definitions/declarations for setjmp/longjmp routines
3: *
1.1.1.4 ! root 4: * Copyright (c) 1985-1993, Microsoft Corporation. All rights reserved.
1.1 root 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.3 root 12: ****/
1.1 root 13:
14: #ifndef _INC_SETJMP
15:
1.1.1.4 ! root 16: #ifdef __cplusplus
! 17: extern "C" {
! 18: #endif
1.1 root 19:
20:
1.1.1.3 root 21: /*
22: * Conditional macro definition for function calling type and variable type
23: * qualifiers.
24: */
25: #if ( (_MSC_VER >= 800) && (_M_IX86 >= 300) )
26:
27: /*
28: * Definitions for MS C8-32 (386/486) compiler
29: */
30: #define _CRTAPI1 __cdecl
31: #define _CRTAPI2 __cdecl
32:
33: #else
34:
35: /*
36: * Other compilers (e.g., MIPS)
37: */
38: #define _CRTAPI1
39: #define _CRTAPI2
40:
1.1.1.2 root 41: #endif
1.1 root 42:
43:
44:
45:
1.1.1.3 root 46: /*
47: * Definitions specific to particular setjmp implementations.
48: */
49: #ifdef _M_IX86
1.1 root 50:
1.1.1.3 root 51: /*
52: * MS C8-32 or older MS C6-386 compilers
53: */
1.1.1.4 ! root 54: #ifndef _INC_SETJMPEX
1.1.1.3 root 55: #define setjmp _setjmp
1.1.1.4 ! root 56: #endif
1.1.1.2 root 57: #define _JBLEN 8
1.1.1.4 ! root 58: #define _JBTYPE int
1.1.1.2 root 59:
1.1 root 60: /*
1.1.1.4 ! root 61: * Define jump buffer layout for x86 setjmp/longjmp.
1.1 root 62: */
1.1.1.4 ! root 63:
! 64: typedef struct __JUMP_BUFFER {
! 65: unsigned long Ebp;
! 66: unsigned long Ebx;
! 67: unsigned long Edi;
! 68: unsigned long Esi;
! 69: unsigned long Esp;
! 70: unsigned long Eip;
! 71: unsigned long Registration;
! 72: unsigned long TryLevel;
! 73: } _JUMP_BUFFER;
1.1.1.3 root 74:
1.1.1.2 root 75: #else
1.1.1.4 ! root 76:
1.1.1.3 root 77: /*
78: * Assume compiler implements setjmp as a function
79: */
80: #define _setjmp setjmp
1.1 root 81:
1.1.1.2 root 82: #endif
1.1.1.4 ! root 83:
! 84:
! 85: #if defined(_M_MRX000) || defined(_MIPS_)
! 86: /*
! 87: * All MIPS implementations need _JBLEN of 16
! 88: */
! 89: #define _JBLEN 16
! 90: #define _JBTYPE double
! 91:
! 92: /*
! 93: * Define jump buffer layout for MIPS setjmp/longjmp.
! 94: */
! 95:
! 96: typedef struct __JUMP_BUFFER {
! 97: unsigned long FltF20;
! 98: unsigned long FltF21;
! 99: unsigned long FltF22;
! 100: unsigned long FltF23;
! 101: unsigned long FltF24;
! 102: unsigned long FltF25;
! 103: unsigned long FltF26;
! 104: unsigned long FltF27;
! 105: unsigned long FltF28;
! 106: unsigned long FltF29;
! 107: unsigned long FltF30;
! 108: unsigned long FltF31;
! 109: unsigned long IntS0;
! 110: unsigned long IntS1;
! 111: unsigned long IntS2;
! 112: unsigned long IntS3;
! 113: unsigned long IntS4;
! 114: unsigned long IntS5;
! 115: unsigned long IntS6;
! 116: unsigned long IntS7;
! 117: unsigned long IntS8;
! 118: unsigned long IntSp;
! 119: unsigned long Type;
! 120: unsigned long Fir;
! 121: } _JUMP_BUFFER;
! 122:
1.1.1.3 root 123: #endif
124:
1.1.1.4 ! root 125: #if defined(_ALPHA_)
1.1.1.3 root 126:
127: /*
1.1.1.4 ! root 128: * All ALPHA implementations need _JBLEN of 2
1.1.1.3 root 129: */
1.1.1.4 ! root 130:
! 131: #define _JBLEN 2
! 132: #define _JBTYPE double
1.1 root 133:
1.1.1.2 root 134: #endif
1.1 root 135:
136:
137:
1.1.1.2 root 138:
139: /* define the buffer type for holding the state information */
140:
141: #ifndef _JMP_BUF_DEFINED
1.1.1.4 ! root 142: typedef _JBTYPE jmp_buf[_JBLEN];
1.1.1.2 root 143: #define _JMP_BUF_DEFINED
144: #endif
145:
146:
1.1 root 147: /* function prototypes */
148:
1.1.1.4 ! root 149: int _CRTAPI1 setjmp(jmp_buf);
1.1.1.3 root 150: void _CRTAPI1 longjmp(jmp_buf, int);
1.1 root 151:
1.1.1.4 ! root 152: #ifdef __cplusplus
! 153: }
! 154: #endif
1.1 root 155:
156: #define _INC_SETJMP
157: #endif /* _INC_SETJMP */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.