]> git.ipfire.org Git - thirdparty/make.git/commitdiff
Fix GCC compile warning declaration-after-statement on Windows
authorTorbjörn SVENSSON <torbjorn.svensson@foss.st.com>
Fri, 9 Jun 2023 14:09:52 +0000 (16:09 +0200)
committerPaul Smith <psmith@gnu.org>
Sat, 1 Jul 2023 16:49:20 +0000 (12:49 -0400)
* src/w32/w32os.c (check_io_state): Move the HANDLE declarations.

src/w32/w32os.c

index 3382801043d8b7865b86fa14a42f3f291e31b5ec..015b685e3550e5a6915ac3e04b51001baf686e9e 100644 (file)
@@ -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;