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.
11 #pragma pack(push,_CRT_PACKING)
17 typedef enum _EXCEPTION_DISPOSITION
19 ExceptionContinueExecution
,
20 ExceptionContinueSearch
,
21 ExceptionNestedException
,
22 ExceptionCollidedUnwind
,
23 } EXCEPTION_DISPOSITION
;
25 #if (defined(_X86_) && !defined(__x86_64))
26 struct _EXCEPTION_RECORD
;
29 EXCEPTION_DISPOSITION __cdecl
_except_handler(struct _EXCEPTION_RECORD
*_ExceptionRecord
,void *_EstablisherFrame
,struct _CONTEXT
*_ContextRecord
,void *_DispatcherContext
);
30 #elif defined(__ia64__)
32 typedef struct _EXCEPTION_POINTERS
*Exception_info_ptr
;
33 struct _EXCEPTION_RECORD
;
35 struct _DISPATCHER_CONTEXT
;
37 __MINGW_EXTENSION _CRTIMP EXCEPTION_DISPOSITION __cdecl
__C_specific_handler (struct _EXCEPTION_RECORD
*_ExceptionRecord
,unsigned __int64 _MemoryStackFp
,unsigned __int64 _BackingStoreFp
,struct _CONTEXT
*_ContextRecord
,struct _DISPATCHER_CONTEXT
*_DispatcherContext
,unsigned __int64 _GlobalPointer
);
38 #elif defined(__x86_64)
40 struct _EXCEPTION_RECORD
;
42 struct _DISPATCHER_CONTEXT
;
44 _CRTIMP EXCEPTION_DISPOSITION __cdecl
__C_specific_handler (struct _EXCEPTION_RECORD
*_ExceptionRecord
,void *_EstablisherFrame
,struct _CONTEXT
*_ContextRecord
,struct _DISPATCHER_CONTEXT
*_DispatcherContext
);
47 #ifdef _MSC_VER // HACK!!!
48 #define GetExceptionCode _exception_code
49 #define exception_code _exception_code
50 #define GetExceptionInformation (struct _EXCEPTION_POINTERS *)_exception_info
51 #define exception_info (struct _EXCEPTION_POINTERS *)_exception_info
52 #define AbnormalTermination _abnormal_termination
53 #define abnormal_termination _abnormal_termination
56 unsigned long __cdecl
_exception_code(void);
57 void *__cdecl
_exception_info(void);
58 int __cdecl
_abnormal_termination(void);
60 #define EXCEPTION_EXECUTE_HANDLER 1
61 #define EXCEPTION_CONTINUE_SEARCH 0
62 #define EXCEPTION_CONTINUE_EXECUTION -1
66 typedef void (__cdecl
* _PHNDLR
)(int);
69 unsigned long XcptNum
;
74 extern struct _XCPT_ACTION _XcptActTab
[];
75 extern int _XcptActTabCount
;
76 extern int _XcptActTabSize
;
77 extern int _First_FPE_Indx
;
80 int __cdecl
__CppXcptFilter(unsigned long _ExceptionNum
,struct _EXCEPTION_POINTERS
* _ExceptionPtr
);
81 int __cdecl
_XcptFilter(unsigned long _ExceptionNum
,struct _EXCEPTION_POINTERS
* _ExceptionPtr
);
84 * The type of function that is expected as an exception handler to be
85 * installed with _try1.
87 typedef EXCEPTION_DISPOSITION (*PEXCEPTION_HANDLER
)(struct _EXCEPTION_RECORD
*, void*, struct _CONTEXT
*, void*);
91 * This is not entirely necessary, but it is the structure installed by
92 * the _try1 primitive below.
94 typedef struct _EXCEPTION_REGISTRATION
{
95 struct _EXCEPTION_REGISTRATION
*prev
;
96 EXCEPTION_DISPOSITION (*handler
)(struct _EXCEPTION_RECORD
*, void*, struct _CONTEXT
*, void*);
97 } EXCEPTION_REGISTRATION
, *PEXCEPTION_REGISTRATION
;
99 typedef EXCEPTION_REGISTRATION EXCEPTION_REGISTRATION_RECORD
;
100 typedef PEXCEPTION_REGISTRATION PEXCEPTION_REGISTRATION_RECORD
;
103 #if (defined(_X86_) && !defined(__x86_64))
104 #define __try1(pHandler) \
105 __asm__ ("pushl %0;pushl %%fs:0;movl %%esp,%%fs:0;" : : "g" (pHandler));
108 __asm__ ("movl (%%esp),%%eax;movl %%eax,%%fs:0;addl $8,%%esp;" \
110 #elif defined(__x86_64)
111 #define __try1(pHandler) \
112 __asm__ ("pushq %0;pushq %%gs:0;movq %%rsp,%%gs:0;" : : "g" (pHandler));
115 __asm__ ("movq (%%rsp),%%rax;movq %%rax,%%gs:0;addq $16,%%rsp;" \
118 #define __try1(pHandler)