]> gitweb.factorcode.org Git - factor.git/blob - vm/os-windows.hpp
GAME: syntax for defining game entry point with game-loop attributes
[factor.git] / vm / os-windows.hpp
1 #include <ctype.h>
2
3 #ifndef wcslen
4   /* for cygwin */
5   #include <wchar.h>
6 #endif
7
8 namespace factor
9 {
10
11 typedef wchar_t vm_char;
12
13 #define STRING_LITERAL(string) L##string
14
15 #define MAX_UNICODE_PATH 32768
16 #define VM_C_API extern "C" __declspec(dllexport)
17 #define SSCANF swscanf
18 #define STRCMP wcscmp
19 #define STRNCMP wcsncmp
20 #define STRDUP _wcsdup
21 #define FTELL ftello64
22 #define FSEEK fseeko64
23
24 #ifdef WIN64
25         #define CELL_HEX_FORMAT "%Ix"
26 #else
27         #define CELL_HEX_FORMAT "%lx"
28 #endif
29
30 #define OPEN_READ(path) _wfopen(path,L"rb")
31 #define OPEN_WRITE(path) _wfopen(path,L"wb")
32
33 /* Difference between Jan 1 00:00:00 1601 and Jan 1 00:00:00 1970 */
34 #define EPOCH_OFFSET 0x019db1ded53e8000LL
35
36 inline static void init_signals() {}
37 inline static void early_init() {}
38
39 u64 system_micros();
40 u64 nano_count();
41 void sleep_nanos(u64 nsec);
42 long getpagesize();
43
44 }