Disabled ctrl+c on windows (null signal handler). Some small fixes.

develop
Petr Mrázek 2011-07-16 08:00:13 +02:00
parent fd418cd2dc
commit 003ad63c56
2 changed files with 4 additions and 4 deletions

@ -1,6 +1,5 @@
/*
https://github.com/peterix/dfhack
Copyright (c) 2011 Petr Mrázek <peterix@gmail.com>
A thread-safe logging console with a line editor.
@ -19,6 +18,7 @@ the 2010 UNIX computers around.
Copyright (c) 2010, Salvatore Sanfilippo <antirez at gmail dot com>
Copyright (c) 2010, Pieter Noordhuis <pcnoordhuis at gmail dot com>
Copyright (c) 2011, Petr Mrázek <peterix@gmail.com>
All rights reserved.
@ -47,9 +47,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "dfhack/Console.h"
#include "dfhack/extra/stdiostream.h"
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <sstream>
#include <stdio.h>
#include <string.h>

@ -40,8 +40,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include <conio.h>
#include <stdarg.h>
#include "dfhack/extra/stdiostream.h"
#include < process.h>
#include <process.h>
#include <errno.h>
#include <stdio.h>
#include <fcntl.h>
@ -453,6 +452,7 @@ bool Console::init(void)
GetConsoleMode(GetStdHandle(STD_INPUT_HANDLE),&oldMode);
newMode = oldMode | ENABLE_ECHO_INPUT | ENABLE_PROCESSED_INPUT | ENABLE_LINE_INPUT;
SetConsoleMode(GetStdHandle(STD_INPUT_HANDLE),newMode);
SetConsoleCtrlHandler(NULL,true);
std::ios::sync_with_stdio();
// make our own weird streams so our IO isn't redirected