]> vaikene.ee Git - evaf/blob - src/main/GUI/winconsole.cpp
More work on the common library and the main GUI application.
[evaf] / src / main / GUI / winconsole.cpp
1 /**
2 * @file main/GUI/winconsole.cpp
3 * @brief Functions to redirect stdin, stdout and stderr to a separate console on Windows
4 * @author Enar Vaikene
5 *
6 * Copyright (c) 2011 Enar Vaikene
7 *
8 * This file is part of the eVaf C++ cross-platform application development framework.
9 *
10 * This file can be used under the terms of the GNU General Public License
11 * version 3.0 as published by the Free Software Foundation and appearing in
12 * the file LICENSE included in the packaging of this file. Please review the
13 * the following information to ensure the GNU General Public License version
14 * 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html.
15 *
16 * Alternatively, this file may be used in accordance with the Commercial License
17 * Agreement provided with the Software.
18 */
19
20 #ifdef Q_OS_WIN32
21
22 #include "winconsole.h"
23
24 #define _CRT_SECURE_NO_WARNINGS
25
26 #include <windows.h>
27 #include <stdio.h>
28
29 using namespace eVaf::GUI::Internal;
30
31 void enableWinConsole()
32 {
33 AllocConsole();
34 freopen("conin$", "r", stdin);
35 freopen("conout$", "w", stdout);
36 freopen("conout$", "w", stderr);
37 }
38
39 #undef _CRT_SECURE_NO_WARNINGS
40
41 #endif