From: Constantin Wenger Date: Sun, 6 Nov 2011 14:17:18 +0000 (+0100) Subject: Command-line signal handling for Windows X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=61f2cc45c275ce493ec7f53e6f22fb8cda89db31;p=zefram%2Fminetest%2Fminetest_engine.git Command-line signal handling for Windows --- diff --git a/src/porting.cpp b/src/porting.cpp index f349c0ce..f3a0ab07 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<