summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/lzma/CPP/7zip/UI/Console/ConsoleClose.cpp
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2016-04-09 21:45:54 +1000
committer Vas Crabb <vas@vastheman.com>2016-04-09 21:52:08 +1000
commite925c494fe30adafb615c075f5eb692dd2b2effa (patch)
treeeed0b7ccadb049ed2dc8a72282c0235c4e94b6ae /3rdparty/lzma/CPP/7zip/UI/Console/ConsoleClose.cpp
parentb13e02f9751424dfc9ce6070676e2e318087a991 (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.cpp29
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
}