factor/vm/os-windows.hpp

50 lines
1022 B
C++
Raw Normal View History

2009-05-02 05:04:19 -04:00
#include <ctype.h>
#ifndef wcslen
/* for cygwin */
#include <wchar.h>
#endif
2009-05-04 02:46:13 -04:00
namespace factor
{
2009-05-02 05:04:19 -04:00
2009-05-04 05:50:24 -04:00
typedef wchar_t vm_char;
2009-05-02 05:04:19 -04:00
#define STRING_LITERAL(string) L##string
#define MAX_UNICODE_PATH 32768
#define VM_C_API extern "C" __declspec(dllexport)
2009-05-02 05:04:19 -04:00
#define SSCANF swscanf
#define STRCMP wcscmp
#define STRNCMP wcsncmp
#define STRDUP _wcsdup
#define MIN(a,b) ((a)>(b)?(b):(a))
#define FTELL ftello64
#define FSEEK fseeko64
2009-05-02 05:04:19 -04:00
#ifdef WIN64
2009-05-13 02:08:16 -04:00
#define CELL_FORMAT "%Iu"
#define CELL_HEX_FORMAT "%Ix"
#define CELL_HEX_PAD_FORMAT "%016Ix"
2009-05-02 05:04:19 -04:00
#define FIXNUM_FORMAT "%Id"
#else
2009-05-13 02:08:16 -04:00
#define CELL_FORMAT "%lu"
#define CELL_HEX_FORMAT "%lx"
#define CELL_HEX_PAD_FORMAT "%08lx"
2009-05-02 05:04:19 -04:00
#define FIXNUM_FORMAT "%ld"
#endif
#define OPEN_READ(path) _wfopen(path,L"rb")
#define OPEN_WRITE(path) _wfopen(path,L"wb")
/* Difference between Jan 1 00:00:00 1601 and Jan 1 00:00:00 1970 */
#define EPOCH_OFFSET 0x019db1ded53e8000LL
2009-05-05 12:33:35 -04:00
inline static void init_signals() {}
inline static void early_init() {}
2009-05-02 05:04:19 -04:00
2009-05-05 12:33:35 -04:00
s64 current_micros();
2009-09-26 03:41:01 -04:00
long getpagesize();
2009-05-02 05:04:19 -04:00
2009-05-04 02:46:13 -04:00
}