mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-09 00:29:55 -06:00
StdIo: Restore compilation on 32-bit MinGW
In commit e419429616 (StdIo: Restore Windows Console I/O modes on
Ctrl-C, 2025-11-26, v4.1.4~4^2) we relied on the compiler to generate a
lambda with an `operator()` for each calling convention. MSVC does
this, but the GNU compiler for MinGW does not seem to.
This commit is contained in:
@@ -93,19 +93,23 @@ public:
|
|||||||
|
|
||||||
Globals();
|
Globals();
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
static BOOL WINAPI CtrlHandler(DWORD /*dwCtrlType*/)
|
||||||
|
{
|
||||||
|
Get().StdErr.Destroy();
|
||||||
|
Get().StdOut.Destroy();
|
||||||
|
Get().StdIn.Destroy();
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static Globals& Get();
|
static Globals& Get();
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
Globals::Globals()
|
Globals::Globals()
|
||||||
{
|
{
|
||||||
static auto const ctrlHandler = [](DWORD /*dwCtrlType*/) -> BOOL {
|
SetConsoleCtrlHandler(CtrlHandler, TRUE);
|
||||||
Get().StdErr.Destroy();
|
|
||||||
Get().StdOut.Destroy();
|
|
||||||
Get().StdIn.Destroy();
|
|
||||||
return FALSE;
|
|
||||||
};
|
|
||||||
SetConsoleCtrlHandler(ctrlHandler, TRUE);
|
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
Globals::Globals() = default;
|
Globals::Globals() = default;
|
||||||
|
|||||||
Reference in New Issue
Block a user