1 #if defined(__arm__) || defined(__thumb__)
2
3
4
5
6 #define _JBLEN 23
7 #endif
8
9 #if defined(__AVR__)
10 #define _JBLEN 24
11 #endif
12
13 #ifdef __sparc__
14
15
16
17
18 #define _JBLEN 13
19 #endif
20
21 #ifdef __BFIN__
22 #define _JBLEN 40
23 #endif
24
25
26
27 #ifdef __mc68000__
28
29
30
31
32
33 #define _JBLEN 34
34 #endif
35
36 #if defined(__mc68hc11__) || defined(__mc68hc12__) || defined(__mc68hc1x__)
37
38
39
40
41 #define _JBLEN 32
42 #endif
43
44 #if defined(__Z8001__) || defined(__Z8002__)
45
46 #define _JBLEN 20
47 #endif
48
49 #ifdef _AM29K
50
51
52
53
54 #define _JBLEN 9
55 #endif
56
57 #if defined(__CYGWIN__) && !defined (_JBLEN)
58 #define _JBLEN (13 * 4)
59 #elif defined (__i386__)
60 #if defined(__unix__) || defined(__rtems__)
61 # define _JBLEN 9
62 #else
63 #include "setjmp-dj.h"
64 #endif
65 #endif
66
67 #ifdef __x86_64__
68 #define _JBTYPE long long
69 #define _JBLEN 8
70 #endif
71
72 #ifdef __i960__
73 #define _JBLEN 35
74 #endif
75
76 #ifdef __M32R__
77
78
79 #define _JBLEN 10
80 #endif
81
82 #ifdef __mips__
83 #ifdef __mips64
84 #define _JBTYPE long long
85 #endif
86 #ifdef __mips_soft_float
87 #define _JBLEN 11
88 #else
89 #define _JBLEN 23
90 #endif
91 #endif
92
93 #ifdef __m88000__
94 #define _JBLEN 21
95 #endif
96
97 #ifdef __H8300__
98 #define _JBLEN 5
99 #define _JBTYPE int
100 #endif
101
102 #ifdef __H8300H__
103
104 #define _JBLEN 5
105 #define _JBTYPE long
106 #endif
107
108 #if defined (__H8300S__) || defined (__H8300SX__)
109
110 #define _JBLEN 5
111 #define _JBTYPE long
112 #endif
113
114 #ifdef __H8500__
115 #define _JBLEN 4
116 #endif
117
118 #ifdef __sh__
119 #if __SH5__
120 #define _JBLEN 50
121 #define _JBTYPE long long
122 #else
123 #define _JBLEN 20
124 #endif
125 #endif
126
127 #ifdef __v800
128 #define _JBLEN 28
129 #endif
130
131 #ifdef __PPC__
132 #ifdef __ALTIVEC__
133 #define _JBLEN 64
134 #else
135 #define _JBLEN 32
136 #endif
137 #define _JBTYPE double
138 #endif
139
140 #ifdef __hppa__
141
142
143
144 #define _JBLEN 28
145 #endif
146
147 #if defined(__mn10300__) || defined(__mn10200__)
148 #ifdef __AM33_2__
149 #define _JBLEN 26
150 #else
151
152 #define _JBLEN 10
153 #endif
154 #endif
155
156 #ifdef __v850
157
158
159 #define _JBLEN 16
160 #endif
161
162 #if defined(_C4x)
163 #define _JBLEN 10
164 #endif
165 #if defined(_C3x)
166 #define _JBLEN 9
167 #endif
168
169 #ifdef __TIC80__
170 #define _JBLEN 13
171 #endif
172
173 #ifdef __D10V__
174 #define _JBLEN 8
175 #endif
176
177 #ifdef __D30V__
178 #define _JBLEN ((64 + (2*2) + 18 ) / 2)
179 #define _JBTYPE double
180 #endif
181
182 #ifdef __frv__
183 #define _JBLEN (68/2)
184 #define _JBTYPE double
185 #endif
186
187 #ifdef __CRX__
188 #define _JBLEN 9
189 #endif
190
191 #ifdef __fr30__
192 #define _JBLEN 10
193 #endif
194
195 #ifdef __iq2000__
196 #define _JBLEN 32
197 #endif
198
199 #ifdef __mcore__
200 #define _JBLEN 16
201 #endif
202
203 #ifdef __MMIX__
204
205 #define _JBLEN 5
206 #define _JBTYPE unsigned long
207 #endif
208
209 #ifdef __mt__
210 #define _JBLEN 16
211 #endif
212
213 #ifdef __SPU__
214 #define _JBLEN 50
215 #define _JBTYPE __vector signed int
216 #endif
217
218 #ifdef __xstormy16__
219
220 #define _JBLEN 8
221 #endif
222
223 #ifdef __mep__
224
225 #define _JBLEN 19
226 #endif
227
228 #ifdef __CRIS__
229 #define _JBLEN 18
230 #endif
231
232 #ifdef __m32c__
233 #if defined(__r8c_cpu__) || defined(__m16c_cpu__)
234 #define _JBLEN (22/2)
235 #else
236 #define _JBLEN (34/2)
237 #endif
238 #define _JBTYPE unsigned short
239 #endif
240
241 #ifdef _JBLEN
242 #ifdef _JBTYPE
243 typedef _JBTYPE jmp_buf[_JBLEN];
244 #else
245 typedef int jmp_buf[_JBLEN];
246 #endif
247 #endif
248
249 void longjmp(jmp_buf __jmpb, int __retval);
250 int setjmp(jmp_buf __jmpb);
251
252 #if defined(__CYGWIN__) || defined(__rtems__)
253 #include <signal.h>
254
255 #ifdef __cplusplus
256 extern "C" {
257 #endif
258
259
260 typedef int sigjmp_buf[_JBLEN+2];
261
262 #define _SAVEMASK _JBLEN
263 #define _SIGMASK (_JBLEN+1)
264
265 #ifdef __CYGWIN__
266 # define _CYGWIN_WORKING_SIGSETJMP
267 #endif
268
269 #if defined(__GNUC__)
270
271 #define sigsetjmp(env, savemask) \
272 __extension__ \
273 ({ \
274 sigjmp_buf *_sjbuf = &(env); \
275 ((*_sjbuf)[_SAVEMASK] = savemask,\
276 sigprocmask (SIG_SETMASK, 0, (sigset_t *)((*_sjbuf) + _SIGMASK)),\
277 setjmp (*_sjbuf)); \
278 })
279
280 #define siglongjmp(env, val) \
281 __extension__ \
282 ({ \
283 sigjmp_buf *_sjbuf = &(env); \
284 ((((*_sjbuf)[_SAVEMASK]) ? \
285 sigprocmask (SIG_SETMASK, (sigset_t *)((*_sjbuf) + _SIGMASK), 0)\
286 : 0), \
287 longjmp (*_sjbuf, val)); \
288 })
289
290 #else
291
292 #define sigsetjmp(env, savemask) ((env)[_SAVEMASK] = savemask,\
293 sigprocmask (SIG_SETMASK, 0, (sigset_t *) ((env) + _SIGMASK)),\
294 setjmp (env))
295
296 #define siglongjmp(env, val) ((((env)[_SAVEMASK])?\
297 sigprocmask (SIG_SETMASK, (sigset_t *) ((env) + _SIGMASK), 0):0),\
298 longjmp (env, val))
299
300 #endif
301
302 #ifdef __cplusplus
303 }
304 #endif
305 #endif