]> gitweb.factorcode.org Git - factor.git/blob - vm/os-windows-nt.hpp
GAME: syntax for defining game entry point with game-loop attributes
[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 namespace factor
12 {
13
14 typedef char symbol_char;
15
16 #define FACTOR_OS_STRING "winnt"
17 #define FACTOR_DLL L"factor.dll"
18 #define FACTOR_DLL_NAME "factor.dll"
19
20 #define FACTOR_STDCALL __attribute__((stdcall))
21
22 FACTOR_STDCALL LONG exception_handler(PEXCEPTION_POINTERS pe);
23
24 // SSE traps raise these exception codes, which are defined in internal NT headers
25 // but not winbase.h
26 #ifndef STATUS_FLOAT_MULTIPLE_FAULTS
27 #define STATUS_FLOAT_MULTIPLE_FAULTS 0xC00002B4
28 #endif
29
30 #ifndef STATUS_FLOAT_MULTIPLE_TRAPS
31 #define STATUS_FLOAT_MULTIPLE_TRAPS  0xC00002B5
32 #endif
33
34 typedef HANDLE THREADHANDLE;
35
36 THREADHANDLE start_thread(void *(*start_routine)(void *),void *args);
37 inline static THREADHANDLE thread_id() { return GetCurrentThread(); }
38
39 void init_platform_globals();
40 void register_vm_with_thread(factor_vm *vm);
41 factor_vm *tls_vm();
42
43 }