mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-01 00:39:40 +00:00
remove verbose comments and example
This commit is contained in:
parent
56d79bd4e0
commit
74955555b9
2 changed files with 1 additions and 19 deletions
|
@ -53,7 +53,6 @@ namespace Debug
|
||||||
int wrapApplication(int (*innerApplication)(int argc, char *argv[]), int argc, char *argv[], const std::string& appName)
|
int wrapApplication(int (*innerApplication)(int argc, char *argv[]), int argc, char *argv[], const std::string& appName)
|
||||||
{
|
{
|
||||||
#if defined _WIN32
|
#if defined _WIN32
|
||||||
// grab a console window if we don't have one
|
|
||||||
(void)Debug::attachParentConsole();
|
(void)Debug::attachParentConsole();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -14,21 +14,17 @@ namespace Debug {
|
||||||
|
|
||||||
bool attachParentConsole()
|
bool attachParentConsole()
|
||||||
{
|
{
|
||||||
// we already have a console window
|
|
||||||
if (GetConsoleWindow() != nullptr)
|
if (GetConsoleWindow() != nullptr)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// our parent window has a console we can use
|
|
||||||
if (AttachConsole(ATTACH_PARENT_PROCESS))
|
if (AttachConsole(ATTACH_PARENT_PROCESS))
|
||||||
{
|
{
|
||||||
// start with consistent state
|
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
fflush(stderr);
|
fflush(stderr);
|
||||||
std::cout.flush();
|
std::cout.flush();
|
||||||
std::cerr.flush();
|
std::cerr.flush();
|
||||||
|
|
||||||
// fix fprintf(3) and fwprintf(3)
|
// this looks dubious but is really the right way
|
||||||
// this looks strange, but nothing is ever simple on Windows.
|
|
||||||
_wfreopen(L"CON", L"w", stdout);
|
_wfreopen(L"CON", L"w", stdout);
|
||||||
_wfreopen(L"CON", L"w", stderr);
|
_wfreopen(L"CON", L"w", stderr);
|
||||||
_wfreopen(L"CON", L"r", stdin);
|
_wfreopen(L"CON", L"r", stdin);
|
||||||
|
@ -36,19 +32,6 @@ bool attachParentConsole()
|
||||||
freopen("CON", "w", stderr);
|
freopen("CON", "w", stderr);
|
||||||
freopen("CON", "r", stdin);
|
freopen("CON", "r", stdin);
|
||||||
|
|
||||||
// it can be verified that input/output works as expected.
|
|
||||||
#if 0
|
|
||||||
fprintf(stdout, "ascii stdout\n");
|
|
||||||
fwprintf(stdout, L"wide stdout\n");
|
|
||||||
fprintf(stderr, "ascii stderr\n");
|
|
||||||
fwprintf(stderr, L"wide stderr\n");
|
|
||||||
|
|
||||||
std::cout << "ascii cout\n";
|
|
||||||
std::cout << L"wide cout\n";
|
|
||||||
std::cerr << "ascii cerr\n";
|
|
||||||
std::cerr << L"wide cerr\n";
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue