mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-08 16:19:36 -06:00
Merge topic 'stdio-ctrl-c' into release-4.2
c55dfbf656 StdIo: Restore compilation on 32-bit MinGW
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11503
This commit is contained in:
@@ -93,19 +93,23 @@ public:
|
||||
|
||||
Globals();
|
||||
|
||||
#ifdef _WIN32
|
||||
static BOOL WINAPI CtrlHandler(DWORD /*dwCtrlType*/)
|
||||
{
|
||||
Get().StdErr.Destroy();
|
||||
Get().StdOut.Destroy();
|
||||
Get().StdIn.Destroy();
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
static Globals& Get();
|
||||
};
|
||||
|
||||
#ifdef _WIN32
|
||||
Globals::Globals()
|
||||
{
|
||||
static auto const ctrlHandler = [](DWORD /*dwCtrlType*/) -> BOOL {
|
||||
Get().StdErr.Destroy();
|
||||
Get().StdOut.Destroy();
|
||||
Get().StdIn.Destroy();
|
||||
return FALSE;
|
||||
};
|
||||
SetConsoleCtrlHandler(ctrlHandler, TRUE);
|
||||
SetConsoleCtrlHandler(CtrlHandler, TRUE);
|
||||
}
|
||||
#else
|
||||
Globals::Globals() = default;
|
||||
|
||||
Reference in New Issue
Block a user