From 363bdaef8c49f08a0ff38c5b64027f70a0f9d438 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Torbj=C3=B6rn=20SVENSSON?= Date: Fri, 9 Jun 2023 16:09:52 +0200 Subject: [PATCH] Fix GCC compile warning declaration-after-statement on Windows * src/w32/w32os.c (check_io_state): Move the HANDLE declarations. --- src/w32/w32os.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/w32/w32os.c b/src/w32/w32os.c index 33828010..015b685e 100644 --- a/src/w32/w32os.c +++ b/src/w32/w32os.c @@ -35,6 +35,7 @@ unsigned int check_io_state () { static unsigned int state = IO_UNKNOWN; + HANDLE outfd, errfd; /* We only need to compute this once per process. */ if (state != IO_UNKNOWN) @@ -42,8 +43,8 @@ check_io_state () /* Could have used GetHandleInformation, but that isn't supported on Windows 9X. */ - HANDLE outfd = (HANDLE)_get_osfhandle (fileno (stdout)); - HANDLE errfd = (HANDLE)_get_osfhandle (fileno (stderr)); + outfd = (HANDLE)_get_osfhandle (fileno (stdout)); + errfd = (HANDLE)_get_osfhandle (fileno (stderr)); if ((HANDLE)_get_osfhandle (fileno (stdin)) != INVALID_HANDLE_VALUE) state |= IO_STDIN_OK; -- 2.47.3