From 0951f7ce5cc21096180dcf8ed3aa0aa4aef80e63 Mon Sep 17 00:00:00 2001 From: Stefan Boberg Date: Tue, 31 Mar 2026 09:57:25 +0200 Subject: Fix forward declaration order for s_GotSigWinch and SigWinchHandler Move the SIGWINCH signal handler and its flag variable before RawModeGuard, which references them in its constructor. --- src/zenutil/consoletui.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/zenutil/consoletui.cpp') diff --git a/src/zenutil/consoletui.cpp b/src/zenutil/consoletui.cpp index 84af1d372..354d24d8d 100644 --- a/src/zenutil/consoletui.cpp +++ b/src/zenutil/consoletui.cpp @@ -74,6 +74,15 @@ EnableVirtualTerminal() // ANSI escape codes are native on POSIX terminals; nothing to do } +// SIGWINCH (terminal resize) flag — set by signal handler, consumed by TuiReadKey() +static volatile sig_atomic_t s_GotSigWinch = 0; + +static void +SigWinchHandler(int /*Sig*/) +{ + s_GotSigWinch = 1; +} + // RAII guard: switches the terminal to raw/unbuffered input mode and restores // the original attributes on destruction. class RawModeGuard @@ -146,15 +155,6 @@ static bool s_InLiveMode = false; static char s_LastChar = 0; -// SIGWINCH (terminal resize) flag — set by signal handler, consumed by TuiReadKey() -static volatile sig_atomic_t s_GotSigWinch = 0; - -static void -SigWinchHandler(int /*Sig*/) -{ - s_GotSigWinch = 1; -} - #endif // ZEN_PLATFORM_WINDOWS / POSIX ////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3