Merge git://spitspat.com/git/factor

release
U-C4\Administrator 2007-11-24 17:34:37 -06:00
commit 3f69eba1e7
11 changed files with 40 additions and 7 deletions

8
vm/Config.windows.nt Normal file
View File

@ -0,0 +1,8 @@
LIBS = -lm
EXE_SUFFIX=-nt
DLL_SUFFIX=-nt
PLAF_DLL_OBJS += vm/os-windows-nt.o
PLAF_EXE_OBJS += vm/resources.o
PLAF_EXE_OBJS += vm/main-windows-nt.o
CFLAGS += -mwindows
include vm/Config.windows

View File

@ -1,7 +1,2 @@
LIBS = -lm
EXE_SUFFIX=-nt
DLL_SUFFIX=-nt
PLAF_DLL_OBJS += vm/os-windows-nt.o
PLAF_EXE_OBJS += vm/resources.o
PLAF_EXE_OBJS += vm/main-windows-nt.o
include vm/Config.x86.32 vm/Config.windows
include vm/Config.windows.nt
include vm/Config.x86.32

View File

@ -213,6 +213,7 @@ void dump_objects(F_FIXNUM type)
void factorbug(void)
{
reset_stdio();
open_console();
printf("Starting low level debugger...\n");
printf(" Basic commands:\n");

View File

@ -26,6 +26,7 @@ void default_parameters(F_PARAMETERS *p)
p->secure_gc = false;
p->fep = false;
p->console = false;
}
/* Get things started */
@ -110,6 +111,8 @@ void init_factor_from_args(F_CHAR *image, int argc, F_CHAR **argv, bool embedded
p.fep = true;
else if(STRNCMP(argv[i],STR_FORMAT("-i="),3) == 0)
p.image = argv[i] + 3;
else if(STRCMP(argv[i],STR_FORMAT("-console")) == 0)
p.console = true ;
}
init_factor(&p);
@ -135,6 +138,9 @@ void init_factor_from_args(F_CHAR *image, int argc, F_CHAR **argv, bool embedded
nest_stacks();
if(p.console)
open_console();
if(p.fep)
factorbug();

View File

@ -32,6 +32,7 @@ typedef struct {
CELL code_size;
bool secure_gc;
bool fep;
bool console;
} F_PARAMETERS;
void load_image(F_PARAMETERS *p);

View File

@ -256,3 +256,5 @@ void reset_stdio(void)
fcntl(0,F_SETFL,0);
fcntl(1,F_SETFL,0);
}
void open_console(void) { }

View File

@ -39,3 +39,4 @@ s64 current_millis(void);
void sleep_millis(CELL msec);
void reset_stdio(void);
void open_console(void);

View File

@ -46,3 +46,5 @@ void c_to_factor_toplevel(CELL quot)
{
c_to_factor(quot);
}
void open_console(void) { }

View File

@ -24,3 +24,4 @@ char *getenv(char *name);
s64 current_millis(void);
void c_to_factor_toplevel(CELL quot);
void open_console(void);

View File

@ -88,3 +88,17 @@ void c_to_factor_toplevel(CELL quot)
c_to_factor(quot);
RemoveVectoredExceptionHandler((void*)exception_handler);
}
void open_console(void)
{
if(!console_open)
{
if(!AttachConsole(ATTACH_PARENT_PROCESS))
{
if(AllocConsole())
console_open = true;
}
else
console_open = true;
}
}

View File

@ -18,3 +18,5 @@ typedef char F_SYMBOL;
void c_to_factor_toplevel(CELL quot);
long exception_handler(PEXCEPTION_POINTERS pe);
bool console_open;
void open_console(void);