diff terminal_win.c @ 794:792be135d3af

Spawn a terminal for the debugger when needed if we are not already attached to one
author Michael Pavone <pavone@retrodev.com>
date Sun, 26 Jul 2015 01:11:04 -0700
parents
children 1af7d1cdcc66
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/terminal_win.c	Sun Jul 26 01:11:04 2015 -0700
@@ -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);
+	}
+}