]> gitweb.factorcode.org Git - factor.git/blob - vm/os-windows.hpp
e5617213f4a1a01649fae94f690a607b3e471b08
[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 FSEEK fseek
23
24 #ifdef WIN64
25         #define CELL_FORMAT "%Iu"
26         #define CELL_HEX_FORMAT "%Ix"
27         #define CELL_HEX_PAD_FORMAT "%016Ix"
28         #define FIXNUM_FORMAT "%Id"
29 #else
30         #define CELL_FORMAT "%lu"
31         #define CELL_HEX_FORMAT "%lx"
32         #define CELL_HEX_PAD_FORMAT "%08lx"
33         #define FIXNUM_FORMAT "%ld"
34 #endif
35
36 #define OPEN_READ(path) _wfopen(path,L"rb")
37 #define OPEN_WRITE(path) _wfopen(path,L"wb")
38
39 #define print_native_string(string) wprintf(L"%s",string)
40
41 /* Difference between Jan 1 00:00:00 1601 and Jan 1 00:00:00 1970 */
42 #define EPOCH_OFFSET 0x019db1ded53e8000LL
43
44
45 inline static void init_signals() {}
46 inline static void early_init() {}
47
48 s64 current_micros();
49
50 }