diff options
author | 2016-04-09 21:45:54 +1000 | |
---|---|---|
committer | 2016-04-09 21:52:08 +1000 | |
commit | e925c494fe30adafb615c075f5eb692dd2b2effa (patch) | |
tree | eed0b7ccadb049ed2dc8a72282c0235c4e94b6ae /3rdparty/lzma/CPP/7zip/UI/Console/ConsoleClose.cpp | |
parent | b13e02f9751424dfc9ce6070676e2e318087a991 (diff) |
Update LZMA SDK to 15.14
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 } |