Win32: open a console for debugging when -v option is passed
This commit is contained in:
parent
b5d61472e5
commit
7f78f3ec72
15
src/main.c
15
src/main.c
@ -82,6 +82,8 @@
|
|||||||
#if defined(WIN32)
|
#if defined(WIN32)
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <shlwapi.h>
|
#include <shlwapi.h>
|
||||||
|
#include <io.h>
|
||||||
|
#include <fcntl.h>
|
||||||
#elif defined (__MINT__)
|
#elif defined (__MINT__)
|
||||||
#include <mint/osbind.h>
|
#include <mint/osbind.h>
|
||||||
#elif defined(__macosx__)
|
#elif defined(__macosx__)
|
||||||
@ -985,8 +987,19 @@ int Init_program(int argc,char * argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((unsigned)GFX2_verbosity_level >= (unsigned)GFX2_DEBUG)
|
||||||
|
{
|
||||||
// Open a console for debugging...
|
// Open a console for debugging...
|
||||||
//ActivateConsole();
|
if (AllocConsole())
|
||||||
|
{
|
||||||
|
HANDLE handle_out = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||||
|
int hCrt = _open_osfhandle((long) handle_out, _O_TEXT);
|
||||||
|
FILE* hf_out = _fdopen(hCrt, "w");
|
||||||
|
setvbuf(hf_out, NULL, _IONBF, 2);
|
||||||
|
*stdout = *hf_out;
|
||||||
|
*stderr = *hf_out;
|
||||||
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Main.image_width=Screen_width/Pixel_width;
|
Main.image_width=Screen_width/Pixel_width;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user