diff options
author | Michael Pavone <pavone@retrodev.com> | 2015-07-26 01:11:04 -0700 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2015-07-26 01:11:04 -0700 |
commit | bee8b42029900ca034675c54d98813a61ca4407a (patch) | |
tree | ee5d02129ed6f07607bb262b3960e99f3bc379e0 /terminal_win.c | |
parent | 25fc1e88deea8253d9d4b8084485e176eb69abd0 (diff) |
Spawn a terminal for the debugger when needed if we are not already attached to one
Diffstat (limited to 'terminal_win.c')
-rw-r--r-- | terminal_win.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/terminal_win.c b/terminal_win.c new file mode 100644 index 0000000..120a086 --- /dev/null +++ b/terminal_win.c @@ -0,0 +1,13 @@ +#include <windows.h> +#include <stdio.h> + +void init_terminal() +{ + static init_done; + if (!init_done) { + AllocConsole(); + freopen("CONIN$", "r", stdin); + freopen("CONOUT$", "w", stdout); + freopen("CONOUT$", "w", stderr); + } +} |