From 9ec000c570d6b389ae75de0113abffe92c774b7b Mon Sep 17 00:00:00 2001 From: Phil Dawes Date: Tue, 18 Aug 2009 20:03:11 +0100 Subject: [PATCH] Dev checkpoint --- vm/os-windows-nt.cpp | 18 ++++++++++++++++-- vm/vm.hpp | 18 +++++++++++++++--- 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/vm/os-windows-nt.cpp b/vm/os-windows-nt.cpp index b50c9b7af8..8a8b2132ad 100755 --- a/vm/os-windows-nt.cpp +++ b/vm/os-windows-nt.cpp @@ -3,7 +3,7 @@ namespace factor { -s64 current_micros() +s64 factorvm::current_micros() { FILETIME t; GetSystemTimeAsFileTime(&t); @@ -11,6 +11,11 @@ s64 current_micros() - EPOCH_OFFSET) / 10; } +s64 current_micros() +{ + return vm->current_micros(); +} + FACTOR_STDCALL LONG exception_handler(PEXCEPTION_POINTERS pe) { PEXCEPTION_RECORD e = (PEXCEPTION_RECORD)pe->ExceptionRecord; @@ -58,7 +63,7 @@ FACTOR_STDCALL LONG exception_handler(PEXCEPTION_POINTERS pe) 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)) fatal_error("AddVectoredExceptionHandler failed", 0); @@ -66,6 +71,15 @@ void c_to_factor_toplevel(cell quot) 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() { } diff --git a/vm/vm.hpp b/vm/vm.hpp index 4257d17fd9..fa4c365da6 100644 --- a/vm/vm.hpp +++ b/vm/vm.hpp @@ -649,7 +649,7 @@ struct factorvm { // os-windows -#if defined(WINDOWS) + #if defined(WINDOWS) void init_ffi(); void ffi_dlopen(dll *dll); void *ffi_dlsym(dll *dll, symbol_char *symbol); @@ -663,8 +663,20 @@ struct factorvm { const vm_char *default_image_path(); void windows_image_path(vm_char *full_path, vm_char *temp_path, unsigned int length); 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 };