]> git.ipfire.org Git - thirdparty/make.git/commitdiff
Fix the MS-Windows MinGW build
authorEli Zaretskii <eliz@gnu.org>
Sun, 24 Apr 2016 06:53:38 +0000 (09:53 +0300)
committerEli Zaretskii <eliz@gnu.org>
Sun, 24 Apr 2016 06:53:38 +0000 (09:53 +0300)
* build_w32.bat (GccCompile): Use -std=gnu99, as some code uses
C99 features ('for' loop initial declarations).

* dir.c (print_dir_data_base) [WINDOWS32]: Cast 'mtime' to
'int64_t', and use %I64d to print it, to avoid compile-time
warning about printing a 'time_t' value, which could be either
a 32-bit or a 64 bit integral type.

build_w32.bat
dir.c

index bef80f9261122951e47b697cf3f910dc8fe0c639..9d752581e58704c5beb10c7fbd37ae921d19d402 100755 (executable)
@@ -157,7 +157,7 @@ goto :EOF
 :GccCompile\r
 :: GCC Compile\r
 echo on\r
-gcc -mthreads -Wall -gdwarf-2 -g3 %OPTS% -I%OUTDIR% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H %EXTRAS% -o %OUTDIR%\%1.o -c %1.c\r
+gcc -mthreads -Wall -std=gnu99 -gdwarf-2 -g3 %OPTS% -I%OUTDIR% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H %EXTRAS% -o %OUTDIR%\%1.o -c %1.c\r
 @echo off\r
 goto :EOF\r
 \r
diff --git a/dir.c b/dir.c
index de85a3c7492b66fb1901043ad9071931d42152da..203a14647c7160f7c66b26bb459fce621d9a5bc4 100644 (file)
--- a/dir.c
+++ b/dir.c
@@ -1082,8 +1082,9 @@ print_dir_data_base (void)
           else if (dir->contents->dirfiles.ht_vec == 0)
             {
 #ifdef WINDOWS32
-              printf (_("# %s (key %s, mtime %d): could not be opened.\n"),
-                      dir->name, dir->contents->path_key,dir->contents->mtime);
+              printf (_("# %s (key %s, mtime %I64d): could not be opened.\n"),
+                      dir->name, dir->contents->path_key,
+                     (int64_t)dir->contents->mtime);
 #else  /* WINDOWS32 */
 #ifdef VMS_INO_T
               printf (_("# %s (device %d, inode [%d,%d,%d]): could not be opened.\n"),
@@ -1118,8 +1119,9 @@ print_dir_data_base (void)
                     }
                 }
 #ifdef WINDOWS32
-              printf (_("# %s (key %s, mtime %d): "),
-                      dir->name, dir->contents->path_key, dir->contents->mtime);
+              printf (_("# %s (key %s, mtime %I64d): "),
+                      dir->name, dir->contents->path_key,
+                     (int64_t)dir->contents->mtime);
 #else  /* WINDOWS32 */
 #ifdef VMS_INO_T
               printf (_("# %s (device %d, inode [%d,%d,%d]): "),