tccpp: signal missing #endif error
[tinycc/kirr.git] / win32 / include / setjmp.h
blobe4f142a3f0106f0672f5e054f2b35794f80bf61b
1 /**
2 * This file has no copyright assigned and is placed in the Public Domain.
3 * This file is part of the w64 mingw-runtime package.
4 * No warranty is given; refer to the file DISCLAIMER within this package.
5 */
6 #ifndef _INC_SETJMP
7 #define _INC_SETJMP
9 #include <_mingw.h>
11 #pragma pack(push,_CRT_PACKING)
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
17 #if (defined(_X86_) && !defined(__x86_64))
19 #define _JBLEN 16
20 #define _JBTYPE int
22 typedef struct __JUMP_BUFFER {
23 unsigned long Ebp;
24 unsigned long Ebx;
25 unsigned long Edi;
26 unsigned long Esi;
27 unsigned long Esp;
28 unsigned long Eip;
29 unsigned long Registration;
30 unsigned long TryLevel;
31 unsigned long Cookie;
32 unsigned long UnwindFunc;
33 unsigned long UnwindData[6];
34 } _JUMP_BUFFER;
35 #elif defined(__ia64__)
36 typedef _CRT_ALIGN(16) struct _SETJMP_FLOAT128 {
37 __int64 LowPart;
38 __int64 HighPart;
39 } SETJMP_FLOAT128;
41 #define _JBLEN 33
42 typedef SETJMP_FLOAT128 _JBTYPE;
44 typedef struct __JUMP_BUFFER {
46 unsigned long iAReserved[6];
48 unsigned long Registration;
49 unsigned long TryLevel;
50 unsigned long Cookie;
51 unsigned long UnwindFunc;
53 unsigned long UnwindData[6];
55 SETJMP_FLOAT128 FltS0;
56 SETJMP_FLOAT128 FltS1;
57 SETJMP_FLOAT128 FltS2;
58 SETJMP_FLOAT128 FltS3;
59 SETJMP_FLOAT128 FltS4;
60 SETJMP_FLOAT128 FltS5;
61 SETJMP_FLOAT128 FltS6;
62 SETJMP_FLOAT128 FltS7;
63 SETJMP_FLOAT128 FltS8;
64 SETJMP_FLOAT128 FltS9;
65 SETJMP_FLOAT128 FltS10;
66 SETJMP_FLOAT128 FltS11;
67 SETJMP_FLOAT128 FltS12;
68 SETJMP_FLOAT128 FltS13;
69 SETJMP_FLOAT128 FltS14;
70 SETJMP_FLOAT128 FltS15;
71 SETJMP_FLOAT128 FltS16;
72 SETJMP_FLOAT128 FltS17;
73 SETJMP_FLOAT128 FltS18;
74 SETJMP_FLOAT128 FltS19;
75 __int64 FPSR;
76 __int64 StIIP;
77 __int64 BrS0;
78 __int64 BrS1;
79 __int64 BrS2;
80 __int64 BrS3;
81 __int64 BrS4;
82 __int64 IntS0;
83 __int64 IntS1;
84 __int64 IntS2;
85 __int64 IntS3;
86 __int64 RsBSP;
87 __int64 RsPFS;
88 __int64 ApUNAT;
89 __int64 ApLC;
90 __int64 IntSp;
91 __int64 IntNats;
92 __int64 Preds;
94 } _JUMP_BUFFER;
95 #elif defined(__x86_64)
96 typedef _CRT_ALIGN(16) struct _SETJMP_FLOAT128 {
97 unsigned __int64 Part[2];
98 } SETJMP_FLOAT128;
100 #define _JBLEN 16
101 typedef SETJMP_FLOAT128 _JBTYPE;
103 typedef struct _JUMP_BUFFER {
104 unsigned __int64 Frame;
105 unsigned __int64 Rbx;
106 unsigned __int64 Rsp;
107 unsigned __int64 Rbp;
108 unsigned __int64 Rsi;
109 unsigned __int64 Rdi;
110 unsigned __int64 R12;
111 unsigned __int64 R13;
112 unsigned __int64 R14;
113 unsigned __int64 R15;
114 unsigned __int64 Rip;
115 unsigned __int64 Spare;
116 SETJMP_FLOAT128 Xmm6;
117 SETJMP_FLOAT128 Xmm7;
118 SETJMP_FLOAT128 Xmm8;
119 SETJMP_FLOAT128 Xmm9;
120 SETJMP_FLOAT128 Xmm10;
121 SETJMP_FLOAT128 Xmm11;
122 SETJMP_FLOAT128 Xmm12;
123 SETJMP_FLOAT128 Xmm13;
124 SETJMP_FLOAT128 Xmm14;
125 SETJMP_FLOAT128 Xmm15;
126 } _JUMP_BUFFER;
127 #endif
128 #ifndef _JMP_BUF_DEFINED
129 typedef _JBTYPE jmp_buf[_JBLEN];
130 #define _JMP_BUF_DEFINED
131 #endif
133 void * __cdecl __attribute__ ((__nothrow__)) mingw_getsp(void);
135 #ifdef USE_MINGW_SETJMP_TWO_ARGS
136 #ifndef _INC_SETJMPEX
137 #define setjmp(BUF) _setjmp((BUF),mingw_getsp())
138 int __cdecl __attribute__ ((__nothrow__)) _setjmp(jmp_buf _Buf,void *_Ctx);
139 #else
140 #undef setjmp
141 #define setjmp(BUF) _setjmpex((BUF),mingw_getsp())
142 #define setjmpex(BUF) _setjmpex((BUF),mingw_getsp())
143 int __cdecl __attribute__ ((__nothrow__)) _setjmpex(jmp_buf _Buf,void *_Ctx);
144 #endif
145 #else
146 #ifndef _INC_SETJMPEX
147 #define setjmp _setjmp
148 #endif
149 int __cdecl __attribute__ ((__nothrow__)) setjmp(jmp_buf _Buf);
150 #endif
152 __declspec(noreturn) __attribute__ ((__nothrow__)) void __cdecl ms_longjmp(jmp_buf _Buf,int _Value)/* throw(...)*/;
153 __declspec(noreturn) __attribute__ ((__nothrow__)) void __cdecl longjmp(jmp_buf _Buf,int _Value);
155 #ifdef __cplusplus
157 #endif
159 #pragma pack(pop)
160 #endif