2003-01-07 Dietmar Maurer <dietmar@ximian.com>
[mono.git] / mono / jit / win32-exception.h
1 #ifndef _MONO_WIN32_EXCEPTION_H_
2 #define _MONO_WIN32_EXCEPTION_H_
3
4 #include <config.h>
5
6 #ifdef __cplusplus
7 extern "C" {
8 #endif
9
10
11 #ifdef PLATFORM_WIN32
12
13 #include <windows.h>
14
15 /* use SIG* defines if possible */
16 #ifdef HAVE_SIGNAL_H
17 #include <signal.h>
18 #endif
19
20 /* sigcontext surrogate */
21 struct sigcontext {
22         unsigned int eax;
23         unsigned int ebx;
24         unsigned int ecx;
25         unsigned int edx;
26         unsigned int ebp;
27         unsigned int esp;
28         unsigned int esi;
29         unsigned int edi;
30         unsigned int eip;
31 };
32
33
34 typedef void (* MonoW32ExceptionHandler) (int);
35 void win32_seh_init(void);
36 void win32_seh_cleanup(void);
37 void win32_seh_set_handler(int type, MonoW32ExceptionHandler handler);
38
39 #ifndef SIGFPE
40 #define SIGFPE 4
41 #endif
42
43 #ifndef SIGILL
44 #define SIGILL 8
45 #endif
46
47 #ifndef SIGSEGV
48 #define SIGSEGV 11
49 #endif
50
51 #endif /* PLATFORM_WIN32 */
52
53
54 #ifdef __cplusplus
55 }
56 #endif
57
58 #endif /* _MONO_WIN32_EXCEPTION_H_ */