From 1f1bf2576eade986be85fcf50152a260c2975229 Mon Sep 17 00:00:00 2001 From: Constantin Wenger Date: Sun, 6 Nov 2011 15:17:18 +0100 Subject: [PATCH] added signalhandling for windows --- src/porting.cpp | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/src/porting.cpp b/src/porting.cpp index f349c0ce5..f3a0ab074 100644 --- a/src/porting.cpp +++ b/src/porting.cpp @@ -75,10 +75,45 @@ void signal_handler_init(void) } #else // _WIN32 + #include + #include + + BOOL WINAPI event_handler(DWORD sig) + { + switch(sig) + { + case CTRL_C_EVENT: + case CTRL_CLOSE_EVENT: + case CTRL_LOGOFF_EVENT: + case CTRL_SHUTDOWN_EVENT: + if(g_killed == false) + { + dstream<