added code to help debug issue #6: made Win32 app show stdout and stderr, if and when it is run from a command prompt window

This commit is contained in:
David Ludwig 2017-08-14 21:14:34 -04:00
parent b9c9687153
commit 6abc599ddf
1 changed files with 7 additions and 0 deletions

View File

@ -212,6 +212,13 @@ int main(int argc, char **argv)
char str[256];
bool cd_boot = false;
// Make sure stdout and stderr gets displayed, if and when the app is run
// via a command prompt window.
if (AttachConsole(ATTACH_PARENT_PROCESS)) {
freopen("CONOUT$", "w", stdout);
freopen("CONOUT$", "w", stderr);
}
// Initialize variables
RAMBaseHost = NULL;
ROMBaseHost = NULL;