]> gitweb.factorcode.org Git - factor.git/blob - vm/os-windows.hpp
Merge branch 'master' into nanos
[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 MIN(a,b) ((a)>(b)?(b):(a))
22 #define FTELL ftello64
23 #define FSEEK fseeko64
24
25 #ifdef WIN64
26         #define CELL_FORMAT "%Iu"
27         #define CELL_HEX_FORMAT "%Ix"
28         #define CELL_HEX_PAD_FORMAT "%016Ix"
29         #define FIXNUM_FORMAT "%Id"
30 #else
31         #define CELL_FORMAT "%lu"
32         #define CELL_HEX_FORMAT "%lx"
33         #define CELL_HEX_PAD_FORMAT "%08lx"
34         #define FIXNUM_FORMAT "%ld"
35 #endif
36
37 #define OPEN_READ(path) _wfopen(path,L"rb")
38 #define OPEN_WRITE(path) _wfopen(path,L"wb")
39
40 /* Difference between Jan 1 00:00:00 1601 and Jan 1 00:00:00 1970 */
41 #define EPOCH_OFFSET 0x019db1ded53e8000LL
42
43 inline static void init_signals() {}
44 inline static void early_init() {}
45
46 u64 system_micros();
47 u64 nano_count();
48 long getpagesize();
49
50 }