diff options
Diffstat (limited to '3rdparty/lzma/CPP/7zip/UI/Console/ConsoleClose.cpp')
-rw-r--r-- | 3rdparty/lzma/CPP/7zip/UI/Console/ConsoleClose.cpp | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/3rdparty/lzma/CPP/7zip/UI/Console/ConsoleClose.cpp b/3rdparty/lzma/CPP/7zip/UI/Console/ConsoleClose.cpp index 5acae942dd8..734981886d0 100644 --- a/3rdparty/lzma/CPP/7zip/UI/Console/ConsoleClose.cpp +++ b/3rdparty/lzma/CPP/7zip/UI/Console/ConsoleClose.cpp @@ -4,11 +4,15 @@ #include "ConsoleClose.h" -static int g_BreakCounter = 0; -static const int kBreakAbortThreshold = 2; +#if !defined(UNDER_CE) && defined(_WIN32) +#include "../../../Common/MyWindows.h" +#endif namespace NConsoleClose { +unsigned g_BreakCounter = 0; +static const unsigned kBreakAbortThreshold = 2; + #if !defined(UNDER_CE) && defined(_WIN32) static BOOL WINAPI HandlerRoutine(DWORD ctrlType) { @@ -23,7 +27,7 @@ static BOOL WINAPI HandlerRoutine(DWORD ctrlType) return TRUE; return FALSE; /* - switch(ctrlType) + switch (ctrlType) { case CTRL_C_EVENT: case CTRL_BREAK_EVENT: @@ -35,29 +39,18 @@ static BOOL WINAPI HandlerRoutine(DWORD ctrlType) } #endif -bool TestBreakSignal() -{ - #ifdef UNDER_CE - return false; - #else - /* - if (g_BreakCounter > 0) - return true; - */ - return (g_BreakCounter > 0); - #endif -} - +/* void CheckCtrlBreak() { if (TestBreakSignal()) throw CCtrlBreakException(); } +*/ CCtrlHandlerSetter::CCtrlHandlerSetter() { #if !defined(UNDER_CE) && defined(_WIN32) - if(!SetConsoleCtrlHandler(HandlerRoutine, TRUE)) + if (!SetConsoleCtrlHandler(HandlerRoutine, TRUE)) throw "SetConsoleCtrlHandler fails"; #endif } @@ -65,7 +58,7 @@ CCtrlHandlerSetter::CCtrlHandlerSetter() CCtrlHandlerSetter::~CCtrlHandlerSetter() { #if !defined(UNDER_CE) && defined(_WIN32) - if(!SetConsoleCtrlHandler(HandlerRoutine, FALSE)) + if (!SetConsoleCtrlHandler(HandlerRoutine, FALSE)) throw "SetConsoleCtrlHandler fails"; #endif } |