]> gitweb.factorcode.org Git - factor.git/blob - vm/os-windows-nt.hpp
Safe SEH is better than abstinence
[factor.git] / vm / os-windows-nt.hpp
1 #undef _WIN32_WINNT
2 #define _WIN32_WINNT 0x0501  // For AddVectoredExceptionHandler
3
4 #ifndef UNICODE
5 #define UNICODE
6 #endif
7
8 #include <windows.h>
9 #include <shellapi.h>
10
11 #ifdef _MSC_VER
12         #undef min
13         #undef max
14 #endif
15
16 namespace factor
17 {
18
19 typedef char symbol_char;
20
21 #define FACTOR_OS_STRING "winnt"
22
23 #define FACTOR_DLL NULL
24
25 extern "C" LONG exception_handler(PEXCEPTION_RECORD e, void *frame, PCONTEXT c, void *dispatch);
26
27 // SSE traps raise these exception codes, which are defined in internal NT headers
28 // but not winbase.h
29 #ifndef STATUS_FLOAT_MULTIPLE_FAULTS
30 #define STATUS_FLOAT_MULTIPLE_FAULTS 0xC00002B4
31 #endif
32
33 #ifndef STATUS_FLOAT_MULTIPLE_TRAPS
34 #define STATUS_FLOAT_MULTIPLE_TRAPS  0xC00002B5
35 #endif
36
37 typedef HANDLE THREADHANDLE;
38
39 THREADHANDLE start_thread(void *(*start_routine)(void *),void *args);
40 inline static THREADHANDLE thread_id() { return GetCurrentThread(); }
41
42 }