Reuse existing console if present, or else open a new console, when -console is supplied
parent
3a5f3c69dc
commit
0da81b3018
|
@ -91,4 +91,14 @@ void c_to_factor_toplevel(CELL quot)
|
|||
|
||||
void open_console(void)
|
||||
{
|
||||
if(!console_open)
|
||||
{
|
||||
if(!AttachConsole(ATTACH_PARENT_PROCESS))
|
||||
{
|
||||
if(AllocConsole())
|
||||
console_open = true;
|
||||
}
|
||||
else
|
||||
console_open = true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,4 +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);
|
||||
|
|
Loading…
Reference in New Issue