Dev checkpoint

Phil Dawes 2009-08-18 20:03:11 +01:00
parent 1431ae806f
commit 9ec000c570
2 changed files with 31 additions and 5 deletions

View File

@ -3,7 +3,7 @@
namespace factor namespace factor
{ {
s64 current_micros() s64 factorvm::current_micros()
{ {
FILETIME t; FILETIME t;
GetSystemTimeAsFileTime(&t); GetSystemTimeAsFileTime(&t);
@ -11,6 +11,11 @@ s64 current_micros()
- EPOCH_OFFSET) / 10; - EPOCH_OFFSET) / 10;
} }
s64 current_micros()
{
return vm->current_micros();
}
FACTOR_STDCALL LONG exception_handler(PEXCEPTION_POINTERS pe) FACTOR_STDCALL LONG exception_handler(PEXCEPTION_POINTERS pe)
{ {
PEXCEPTION_RECORD e = (PEXCEPTION_RECORD)pe->ExceptionRecord; PEXCEPTION_RECORD e = (PEXCEPTION_RECORD)pe->ExceptionRecord;
@ -58,7 +63,7 @@ FACTOR_STDCALL LONG exception_handler(PEXCEPTION_POINTERS pe)
return EXCEPTION_CONTINUE_EXECUTION; return EXCEPTION_CONTINUE_EXECUTION;
} }
void c_to_factor_toplevel(cell quot) void factorvm::c_to_factor_toplevel(cell quot)
{ {
if(!AddVectoredExceptionHandler(0, (PVECTORED_EXCEPTION_HANDLER)exception_handler)) if(!AddVectoredExceptionHandler(0, (PVECTORED_EXCEPTION_HANDLER)exception_handler))
fatal_error("AddVectoredExceptionHandler failed", 0); fatal_error("AddVectoredExceptionHandler failed", 0);
@ -66,6 +71,15 @@ void c_to_factor_toplevel(cell quot)
RemoveVectoredExceptionHandler((void *)exception_handler); RemoveVectoredExceptionHandler((void *)exception_handler);
} }
void c_to_factor_toplevel(cell quot)
{
return vm->c_to_factor_toplevel(quot);
}
void factorvm::open_console()
{
}
void open_console() void open_console()
{ {
} }

View File

@ -649,7 +649,7 @@ struct factorvm {
// os-windows // os-windows
#if defined(WINDOWS) #if defined(WINDOWS)
void init_ffi(); void init_ffi();
void ffi_dlopen(dll *dll); void ffi_dlopen(dll *dll);
void *ffi_dlsym(dll *dll, symbol_char *symbol); void *ffi_dlsym(dll *dll, symbol_char *symbol);
@ -663,8 +663,20 @@ struct factorvm {
const vm_char *default_image_path(); const vm_char *default_image_path();
void windows_image_path(vm_char *full_path, vm_char *temp_path, unsigned int length); void windows_image_path(vm_char *full_path, vm_char *temp_path, unsigned int length);
bool windows_stat(vm_char *path); bool windows_stat(vm_char *path);
// next method here:
#endif #if defined(WINCE)
#else /* WINNT */
s64 current_micros();
void c_to_factor_toplevel(cell quot);
void open_console();
// next method here:
#endif
#ifdef FACTOR_X86
#endif
#endif
}; };