freopen_s() is not available for mingw.
This commit is contained in:
parent
cb4c1aa10b
commit
16b67644b0
|
@ -262,9 +262,14 @@ void VAbstractApplication::WinAttachConsole()
|
||||||
auto stdout_type = GetFileType(GetStdHandle(STD_OUTPUT_HANDLE));
|
auto stdout_type = GetFileType(GetStdHandle(STD_OUTPUT_HANDLE));
|
||||||
if (stdout_type == FILE_TYPE_UNKNOWN && AttachConsole(ATTACH_PARENT_PROCESS))
|
if (stdout_type == FILE_TYPE_UNKNOWN && AttachConsole(ATTACH_PARENT_PROCESS))
|
||||||
{
|
{
|
||||||
|
#ifdef Q_CC_MSVC
|
||||||
FILE *fp = nullptr;
|
FILE *fp = nullptr;
|
||||||
freopen_s(&fp, "CONOUT$", "w", stdout);
|
freopen_s(&fp, "CONOUT$", "w", stdout);
|
||||||
freopen_s(&fp, "CONOUT$", "w", stderr);
|
freopen_s(&fp, "CONOUT$", "w", stderr);
|
||||||
|
#else
|
||||||
|
freopen("CONOUT$", "w", stdout);
|
||||||
|
freopen("CONOUT$", "w", stderr);
|
||||||
|
#endif // Q_CC_MSVC
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue
Block a user