Fix POST with streams to use chunked encoding, add http-put word
[factor/jcg.git] / vm / os-windows.h
bloba9c3f6d803aa3ee4b23495884abe1dcde693b09b
1 #include <ctype.h>
3 #ifndef wcslen
4 /* for cygwin */
5 #include <wchar.h>
6 #endif
8 typedef wchar_t F_CHAR;
10 #define from_native_string from_u16_string
11 #define unbox_native_string unbox_u16_string
12 #define string_to_native_alien(string) string_to_u16_alien(string,true)
14 #define STRING_LITERAL(string) L##string
16 #define MAX_UNICODE_PATH 32768
17 #define DLLEXPORT __declspec(dllexport)
18 #define SSCANF swscanf
19 #define STRCMP wcscmp
20 #define STRNCMP wcsncmp
21 #define STRDUP _wcsdup
23 #ifdef WIN64
24 #define CELL_FORMAT "%Iu"
25 #define CELL_HEX_FORMAT "%Ix"
26 #define CELL_HEX_PAD_FORMAT "%016Ix"
27 #define FIXNUM_FORMAT "%Id"
28 #else
29 #define CELL_FORMAT "%lu"
30 #define CELL_HEX_FORMAT "%lx"
31 #define CELL_HEX_PAD_FORMAT "%08lx"
32 #define FIXNUM_FORMAT "%ld"
33 #endif
35 #define OPEN_READ(path) _wfopen(path,L"rb")
36 #define OPEN_WRITE(path) _wfopen(path,L"wb")
38 #define print_native_string(string) wprintf(L"%s",string)
40 /* Difference between Jan 1 00:00:00 1601 and Jan 1 00:00:00 1970 */
41 #define EPOCH_OFFSET 0x019db1ded53e8000LL
43 F_STRING *get_error_message(void);
44 DLLEXPORT F_CHAR *error_message(DWORD id);
45 void windows_error(void);
47 void init_ffi(void);
48 void ffi_dlopen(F_DLL *dll);
49 void *ffi_dlsym(F_DLL *dll, F_SYMBOL *symbol);
50 void ffi_dlclose(F_DLL *dll);
52 void sleep_micros(u64 msec);
54 INLINE void init_signals(void) {}
55 INLINE void early_init(void) {}
56 const F_CHAR *vm_executable_path(void);
57 const F_CHAR *default_image_path(void);
58 long getpagesize (void);
60 s64 current_micros(void);