|
|
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: *
12: ****/
13:
14: #ifndef _INC_SETJMP
15:
16: #ifndef __cplusplus
17:
18:
19: /*
20: * Conditional macro definition for function calling type and variable type
21: * qualifiers.
22: */
23: #if ( (_MSC_VER >= 800) && (_M_IX86 >= 300) )
24:
25: /*
26: * Definitions for MS C8-32 (386/486) compiler
27: */
28: #define _CRTAPI1 __cdecl
29: #define _CRTAPI2 __cdecl
30:
31: #elif ( _MSC_VER == 600 )
32:
33: /*
34: * Definitions for old MS C6-386 compiler
35: */
36: #define _CRTAPI1 _cdecl
37: #define _CRTAPI2 _cdecl
38: #define _M_IX86 300
39:
40: #else
41:
42: /*
43: * Other compilers (e.g., MIPS)
44: */
45: #define _CRTAPI1
46: #define _CRTAPI2
47:
48: #endif
49:
50: /*
51: * Definitions specific to particular setjmp implementations.
52: */
53: #ifdef _M_IX86
54:
55: /*
56: * MS C8-32 or older MS C6-386 compilers
57: */
58: #define setjmp _setjmp
59: #define _JBLEN 8
60:
61: #else
62:
63: /*
64: * Assume compiler implements setjmp as a function
65: */
66:
67: #define _setjmp setjmp
68:
69: #endif
70:
71:
72: #if ( defined(_M_RX000) || defined(M_MRX000) || defined(MIPS) || defined(MIPS) )
73: /*
74: * All MIPS implementation need _JBLEN of 2
75: */
76: #define _JBLEN 2
77:
78: #endif
79:
80: /* define the buffer type for holding the state information */
81:
82: #ifndef _JMP_BUF_DEFINED
83: typedef int jmp_buf[_JBLEN];
84: #define _JMP_BUF_DEFINED
85: #endif
86:
87: #ifndef _SIGJMP_BUF_DEFINED
88: #define _SIGJMP_BUF_DEFINED
89: /*
90: * sigjmp buf is just a jmp_buf plus an int to say whether the sigmask
91: * is saved or not, and a sigmask_t for the mask if it is saved.
92: */
93:
94: typedef unsigned long sigjmp_buf[_JBLEN + 2];
95: #endif /* _SIGJMP_BUF_DEFINED */
96:
97: #define sigsetjmp(env, save) \
98: (((save) ? ((env)[_JBLEN] = 1, sigprocmask(SIG_SETMASK, \
99: &(env)[_JBLEN + 1], 0)) \
100: : ((env)[_JBLEN] = 0)), \
101: setjmp(&(env)[0]))
102:
103: /* function prototypes */
104:
105: int _CRTAPI1 setjmp(jmp_buf);
106: void _CRTAPI1 longjmp(jmp_buf, int);
107: void _CRTAPI1 siglongjmp(sigjmp_buf, int);
108:
109: /* function prototypes */
110:
111: #endif /* __cplusplus */
112:
113: #define _INC_SETJMP
114: #endif /* _INC_SETJMP */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.