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 struct _EXCEPTION_POINTERS
;
19 #ifndef EXCEPTION_DISPOSITION
20 #define EXCEPTION_DISPOSITION int
22 #define ExceptionContinueExecution 0
23 #define ExceptionContinueSearch 1
24 #define ExceptionNestedException 2
25 #define ExceptionCollidedUnwind 3
27 #if (defined(_X86_) && !defined(__x86_64))
28 struct _EXCEPTION_RECORD
;
31 EXCEPTION_DISPOSITION __cdecl
_except_handler(struct _EXCEPTION_RECORD
*_ExceptionRecord
,void *_EstablisherFrame
,struct _CONTEXT
*_ContextRecord
,void *_DispatcherContext
);
32 #elif defined(__ia64__)
34 typedef struct _EXCEPTION_POINTERS
*Exception_info_ptr
;
35 struct _EXCEPTION_RECORD
;
37 struct _DISPATCHER_CONTEXT
;
39 _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
);
40 #elif defined(__x86_64)
42 struct _EXCEPTION_RECORD
;
46 #define GetExceptionCode _exception_code
47 #define exception_code _exception_code
48 #define GetExceptionInformation (struct _EXCEPTION_POINTERS *)_exception_info
49 #define exception_info (struct _EXCEPTION_POINTERS *)_exception_info
50 #define AbnormalTermination _abnormal_termination
51 #define abnormal_termination _abnormal_termination
53 unsigned long __cdecl
_exception_code(void);
54 void *__cdecl
_exception_info(void);
55 int __cdecl
_abnormal_termination(void);
57 #define EXCEPTION_EXECUTE_HANDLER 1
58 #define EXCEPTION_CONTINUE_SEARCH 0
59 #define EXCEPTION_CONTINUE_EXECUTION -1
62 typedef void (__cdecl
* _PHNDLR
)(int);
65 unsigned long XcptNum
;
70 extern struct _XCPT_ACTION _XcptActTab
[];
71 extern int _XcptActTabCount
;
72 extern int _XcptActTabSize
;
73 extern int _First_FPE_Indx
;
76 int __cdecl
__CppXcptFilter(unsigned long _ExceptionNum
,struct _EXCEPTION_POINTERS
* _ExceptionPtr
);
77 int __cdecl
_XcptFilter(unsigned long _ExceptionNum
,struct _EXCEPTION_POINTERS
* _ExceptionPtr
);
80 * The type of function that is expected as an exception handler to be
81 * installed with _try1.
83 typedef EXCEPTION_DISPOSITION (*PEXCEPTION_HANDLER
)(struct _EXCEPTION_RECORD
*, void*, struct _CONTEXT
*, void*);
87 * This is not entirely necessary, but it is the structure installed by
88 * the _try1 primitive below.
90 typedef struct _EXCEPTION_REGISTRATION
{
91 struct _EXCEPTION_REGISTRATION
*prev
;
92 EXCEPTION_DISPOSITION (*handler
)(struct _EXCEPTION_RECORD
*, void*, struct _CONTEXT
*, void*);
93 } EXCEPTION_REGISTRATION
, *PEXCEPTION_REGISTRATION
;
95 typedef EXCEPTION_REGISTRATION EXCEPTION_REGISTRATION_RECORD
;
96 typedef PEXCEPTION_REGISTRATION PEXCEPTION_REGISTRATION_RECORD
;
99 #if (defined(_X86_) && !defined(__x86_64))
100 #define __try1(pHandler) \
101 __asm__ ("pushl %0;pushl %%fs:0;movl %%esp,%%fs:0;" : : "g" (pHandler));
104 __asm__ ("movl (%%esp),%%eax;movl %%eax,%%fs:0;addl $8,%%esp;" \
106 #elif defined(__x86_64)
107 #define __try1(pHandler) \
108 __asm__ ("pushq %0;pushq %%gs:0;movq %%rsp,%%gs:0;" : : "g" (pHandler));
111 __asm__ ("movq (%%rsp),%%rax;movq %%rax,%%gs:0;addq $16,%%rsp;" \
114 #define __try1(pHandler)