This repository has been archived by the owner on Dec 11, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathsetjmp.h
279 lines (239 loc) · 7.24 KB
/
setjmp.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
/**
* This file has no copyright assigned and is placed in the Public Domain.
* This file is part of the mingw-w64 runtime package.
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
*/
#ifndef _INC_SETJMP
#define _INC_SETJMP
#include <crtdefs.h>
#pragma pack(push,_CRT_PACKING)
#ifndef NULL
#ifdef __cplusplus
#ifndef _WIN64
#define NULL 0
#else
#define NULL 0LL
#endif /* W64 */
#else
#define NULL ((void *)0)
#endif
#endif
#ifdef __cplusplus
extern "C" {
#endif
#if (defined(_X86_) && !defined(__x86_64))
#define _JBLEN 16
#define _JBTYPE int
typedef struct __JUMP_BUFFER {
unsigned long Ebp;
unsigned long Ebx;
unsigned long Edi;
unsigned long Esi;
unsigned long Esp;
unsigned long Eip;
unsigned long Registration;
unsigned long TryLevel;
unsigned long Cookie;
unsigned long UnwindFunc;
unsigned long UnwindData[6];
} _JUMP_BUFFER;
#elif defined(__ia64__)
typedef _CRT_ALIGN(16) struct _SETJMP_FLOAT128 {
__MINGW_EXTENSION __int64 LowPart;
__MINGW_EXTENSION __int64 HighPart;
} SETJMP_FLOAT128;
#define _JBLEN 33
typedef SETJMP_FLOAT128 _JBTYPE;
typedef struct __JUMP_BUFFER {
unsigned long iAReserved[6];
unsigned long Registration;
unsigned long TryLevel;
unsigned long Cookie;
unsigned long UnwindFunc;
unsigned long UnwindData[6];
SETJMP_FLOAT128 FltS0;
SETJMP_FLOAT128 FltS1;
SETJMP_FLOAT128 FltS2;
SETJMP_FLOAT128 FltS3;
SETJMP_FLOAT128 FltS4;
SETJMP_FLOAT128 FltS5;
SETJMP_FLOAT128 FltS6;
SETJMP_FLOAT128 FltS7;
SETJMP_FLOAT128 FltS8;
SETJMP_FLOAT128 FltS9;
SETJMP_FLOAT128 FltS10;
SETJMP_FLOAT128 FltS11;
SETJMP_FLOAT128 FltS12;
SETJMP_FLOAT128 FltS13;
SETJMP_FLOAT128 FltS14;
SETJMP_FLOAT128 FltS15;
SETJMP_FLOAT128 FltS16;
SETJMP_FLOAT128 FltS17;
SETJMP_FLOAT128 FltS18;
SETJMP_FLOAT128 FltS19;
__MINGW_EXTENSION __int64 FPSR;
__MINGW_EXTENSION __int64 StIIP;
__MINGW_EXTENSION __int64 BrS0;
__MINGW_EXTENSION __int64 BrS1;
__MINGW_EXTENSION __int64 BrS2;
__MINGW_EXTENSION __int64 BrS3;
__MINGW_EXTENSION __int64 BrS4;
__MINGW_EXTENSION __int64 IntS0;
__MINGW_EXTENSION __int64 IntS1;
__MINGW_EXTENSION __int64 IntS2;
__MINGW_EXTENSION __int64 IntS3;
__MINGW_EXTENSION __int64 RsBSP;
__MINGW_EXTENSION __int64 RsPFS;
__MINGW_EXTENSION __int64 ApUNAT;
__MINGW_EXTENSION __int64 ApLC;
__MINGW_EXTENSION __int64 IntSp;
__MINGW_EXTENSION __int64 IntNats;
__MINGW_EXTENSION __int64 Preds;
} _JUMP_BUFFER;
#elif defined(__x86_64)
typedef _CRT_ALIGN(16) struct _SETJMP_FLOAT128 {
__MINGW_EXTENSION unsigned __int64 Part[2];
} SETJMP_FLOAT128;
#define _JBLEN 16
typedef SETJMP_FLOAT128 _JBTYPE;
typedef struct _JUMP_BUFFER {
__MINGW_EXTENSION unsigned __int64 Frame;
__MINGW_EXTENSION unsigned __int64 Rbx;
__MINGW_EXTENSION unsigned __int64 Rsp;
__MINGW_EXTENSION unsigned __int64 Rbp;
__MINGW_EXTENSION unsigned __int64 Rsi;
__MINGW_EXTENSION unsigned __int64 Rdi;
__MINGW_EXTENSION unsigned __int64 R12;
__MINGW_EXTENSION unsigned __int64 R13;
__MINGW_EXTENSION unsigned __int64 R14;
__MINGW_EXTENSION unsigned __int64 R15;
__MINGW_EXTENSION unsigned __int64 Rip;
unsigned long MxCsr;
unsigned short FpCsr;
unsigned short Spare;
SETJMP_FLOAT128 Xmm6;
SETJMP_FLOAT128 Xmm7;
SETJMP_FLOAT128 Xmm8;
SETJMP_FLOAT128 Xmm9;
SETJMP_FLOAT128 Xmm10;
SETJMP_FLOAT128 Xmm11;
SETJMP_FLOAT128 Xmm12;
SETJMP_FLOAT128 Xmm13;
SETJMP_FLOAT128 Xmm14;
SETJMP_FLOAT128 Xmm15;
} _JUMP_BUFFER;
#elif defined(_ARM_)
#define _JBLEN 28
#define _JBTYPE int
typedef struct __JUMP_BUFFER {
unsigned long Frame;
unsigned long R4;
unsigned long R5;
unsigned long R6;
unsigned long R7;
unsigned long R8;
unsigned long R9;
unsigned long R10;
unsigned long R11;
unsigned long Sp;
unsigned long Pc;
unsigned long Fpscr;
unsigned long long D[8];
} _JUMP_BUFFER;
#elif defined(_ARM64_)
#define _JBLEN 24
#define _JBTYPE unsigned __int64
typedef struct __JUMP_BUFFER {
unsigned __int64 Frame;
unsigned __int64 Reserved;
unsigned __int64 X19;
unsigned __int64 X20;
unsigned __int64 X21;
unsigned __int64 X22;
unsigned __int64 X23;
unsigned __int64 X24;
unsigned __int64 X25;
unsigned __int64 X26;
unsigned __int64 X27;
unsigned __int64 X28;
unsigned __int64 Fp;
unsigned __int64 Lr;
unsigned __int64 Sp;
unsigned long Fpcr;
unsigned long Fpsr;
double D[8];
} _JUMP_BUFFER;
#else
#define _JBLEN 1
#define _JBTYPE int
#endif
#ifndef _JMP_BUF_DEFINED
typedef _JBTYPE jmp_buf[_JBLEN];
#define _JMP_BUF_DEFINED
#endif
_CRTIMP __MINGW_ATTRIB_NORETURN __attribute__ ((__nothrow__)) void __cdecl longjmp(jmp_buf _Buf,int _Value);
void * __cdecl __attribute__ ((__nothrow__)) mingw_getsp (void);
#pragma push_macro("__has_builtin")
#ifndef __has_builtin
#define __has_builtin(x) 0
#endif
#if !defined(USE_NO_MINGW_SETJMP_TWO_ARGS)
# ifdef _UCRT
# ifdef _WIN64
# define _setjmp __intrinsic_setjmpex
# else
# define _setjmp __intrinsic_setjmp
# endif
# elif defined(__aarch64__)
/* ARM64 msvcrt.dll lacks _setjmp, only has _setjmpex. */
# define _setjmp _setjmpex
# endif
# ifndef _INC_SETJMPEX
# if defined(_X86_) || defined(__i386__)
# define setjmp(BUF) _setjmp3((BUF), NULL)
# elif defined(_ARM_) || defined(__arm__) || ((defined(_ARM64_) || defined(__aarch64__)) && (!defined(__SEH__) || !__has_builtin(__builtin_sponentry)))
# define setjmp(BUF) __mingw_setjmp((BUF))
# define longjmp __mingw_longjmp
int __cdecl __attribute__ ((__nothrow__,__returns_twice__)) __mingw_setjmp(jmp_buf _Buf);
__MINGW_ATTRIB_NORETURN __attribute__ ((__nothrow__)) void __mingw_longjmp(jmp_buf _Buf,int _Value);
# elif defined(__SEH__)
# if defined(__aarch64__) || defined(_ARM64_)
# define setjmp(BUF) _setjmp((BUF), __builtin_sponentry())
# elif (__MINGW_GCC_VERSION < 40702)
# define setjmp(BUF) _setjmp((BUF), mingw_getsp())
# else
# define setjmp(BUF) _setjmp((BUF), __builtin_frame_address (0))
# endif
# else
# define setjmp(BUF) _setjmp((BUF), NULL)
# endif
int __cdecl __attribute__ ((__nothrow__,__returns_twice__)) _setjmp(jmp_buf _Buf, void *_Ctx);
int __cdecl __attribute__ ((__nothrow__,__returns_twice__)) _setjmp3(jmp_buf _Buf, void *_Ctx);
# else
# undef setjmp
# ifdef __SEH__
# if (__MINGW_GCC_VERSION < 40702)
# define setjmp(BUF) _setjmpex((BUF), mingw_getsp())
# define setjmpex(BUF) _setjmpex((BUF), mingw_getsp())
# else
# define setjmp(BUF) _setjmpex((BUF), __builtin_frame_address (0))
# define setjmpex(BUF) _setjmpex((BUF), __builtin_frame_address (0))
# endif
# else
# define setjmp(BUF) _setjmpex((BUF), NULL)
# define setjmpex(BUF) _setjmpex((BUF), NULL)
# endif
int __cdecl __attribute__ ((__nothrow__,__returns_twice__)) _setjmpex(jmp_buf _Buf,void *_Ctx);
# endif
#else
# if !defined(_INC_SETJMPEX)
# define setjmp _setjmp
# endif
int __cdecl __attribute__ ((__nothrow__,__returns_twice__)) setjmp(jmp_buf _Buf);
#endif
#pragma pop_macro("__has_builtin")
#ifdef __cplusplus
}
#endif
#pragma pack(pop)
#endif