]> git.ipfire.org Git - thirdparty/make.git/commitdiff
Fix compile issues with Windows and VMS.
authorPaul Smith <psmith@gnu.org>
Sun, 1 May 2016 19:34:42 +0000 (15:34 -0400)
committerPaul Smith <psmith@gnu.org>
Sat, 21 May 2016 20:21:31 +0000 (16:21 -0400)
* main.c (initialize_stopchar_map): isblank() is not part of C89.
Install bits for space and tab directly.
* makeint.h: Don't define vfork; autoconf handles this for us.
* vmsjobs.c: Rename NEXT_TOKEN to V_NEXT_TOKEN to avoid conflicts.
* dir.c (print_dir_data_base): Visual Studio C doesn't have int64_t.
* w32/subproc/sub_proc.c (process_begin): Missing arg to memset().
* build_w32.bat: Don't use obsolete Visual Studio flags.

build_w32.bat
dir.c
main.c
makeint.h
vmsjobs.c
w32/subproc/sub_proc.c

index 9d752581e58704c5beb10c7fbd37ae921d19d402..59e068b63fc4eb77b04dafa8fcf8e052efa8ded0 100755 (executable)
@@ -149,7 +149,7 @@ if "%COMPILER%" == "gcc" goto GccCompile
 \r
 :: MSVC Compile\r
 echo on\r
-cl.exe /nologo /MT /W4 /GX /YX %OPTS% /I %OUTDIR% /I . /I glob /I w32/include /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR%OUTDIR% /Fp%OUTDIR%\%MAKE%.pch /Fo%OUTDIR%\%1.obj /Fd%OUTDIR%\%MAKE%.pdb %EXTRAS% /c %1.c\r
+cl.exe /nologo /MT /W4 /EHsc %OPTS% /I %OUTDIR% /I . /I glob /I w32/include /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR%OUTDIR% /Fp%OUTDIR%\%MAKE%.pch /Fo%OUTDIR%\%1.obj /Fd%OUTDIR%\%MAKE%.pdb %EXTRAS% /c %1.c\r
 @echo off\r
 echo %OUTDIR%\%1.obj >>%OUTDIR%\link.sc\r
 goto :EOF\r
diff --git a/dir.c b/dir.c
index 203a14647c7160f7c66b26bb459fce621d9a5bc4..a286d2ea1953cb245836013f960d4084bfaa8cba 100644 (file)
--- a/dir.c
+++ b/dir.c
@@ -1082,9 +1082,9 @@ print_dir_data_base (void)
           else if (dir->contents->dirfiles.ht_vec == 0)
             {
 #ifdef WINDOWS32
-              printf (_("# %s (key %s, mtime %I64d): could not be opened.\n"),
+              printf (_("# %s (key %s, mtime %ull): could not be opened.\n"),
                       dir->name, dir->contents->path_key,
-                     (int64_t)dir->contents->mtime);
+                      (unsigned long long)dir->contents->mtime);
 #else  /* WINDOWS32 */
 #ifdef VMS_INO_T
               printf (_("# %s (device %d, inode [%d,%d,%d]): could not be opened.\n"),
@@ -1119,9 +1119,9 @@ print_dir_data_base (void)
                     }
                 }
 #ifdef WINDOWS32
-              printf (_("# %s (key %s, mtime %I64d): "),
+              printf (_("# %s (key %s, mtime %ull): "),
                       dir->name, dir->contents->path_key,
-                     (int64_t)dir->contents->mtime);
+                      (unsigned long long)dir->contents->mtime);
 #else  /* WINDOWS32 */
 #ifdef VMS_INO_T
               printf (_("# %s (device %d, inode [%d,%d,%d]): "),
diff --git a/main.c b/main.c
index 73eaf18155780fc93c34c6e0ca3a54ffc4f00a06..c812ba4ab21f517bd7365361b2219ece25bfba91 100644 (file)
--- a/main.c
+++ b/main.c
@@ -663,6 +663,9 @@ initialize_stopchar_map ()
   stopchar_map[(int)'-'] = MAP_USERFUNC;
   stopchar_map[(int)'_'] = MAP_USERFUNC;
 
+  stopchar_map[(int)' '] = MAP_BLANK;
+  stopchar_map[(int)'\t'] = MAP_BLANK;
+
   stopchar_map[(int)'/'] = MAP_DIRSEP;
 #if defined(VMS)
   stopchar_map[(int)':'] |= MAP_DIRSEP;
@@ -674,9 +677,7 @@ initialize_stopchar_map ()
 
   for (i = 1; i <= UCHAR_MAX; ++i)
     {
-      if (isblank (i))
-        stopchar_map[i] |= MAP_BLANK;
-      else if (isspace (i))
+      if (isspace (i) && NONE_SET (stopchar_map[i], MAP_BLANK))
         /* Don't mark blank characters as newline characters.  */
         stopchar_map[i] |= MAP_NEWLINE;
       else if (isalnum (i))
index 7390da74c4c9bbdd0c3724340aeda267a99f66e4..0ee5acc396f3d9bfe55c7e170956f996d8ec8a5f 100644 (file)
--- a/makeint.h
+++ b/makeint.h
@@ -137,9 +137,6 @@ extern int errno;
 #ifdef HAVE_VFORK_H
 # include <vfork.h>
 #endif
-#if !HAVE_WORKING_VFORK
-# define vfork fork
-#endif
 
 #ifdef  HAVE_LIMITS_H
 # include <limits.h>
index 649479efbba54aa8e3c7084fe1cefd0f07b071c4..f45c8a80a971121e97f0287c1384d2f5d80bb9af 100644 (file)
--- a/vmsjobs.c
+++ b/vmsjobs.c
@@ -264,14 +264,14 @@ tryToSetupYAst(void)
     { token->cmd_errno = ERANGE; return x; }}
 
 /* Check if we are out of space for more tokens */
-#define NEXT_TOKEN { if (cmd_tkn_index < MAX_DCL_TOKENS) \
+#define V_NEXT_TOKEN { if (cmd_tkn_index < MAX_DCL_TOKENS) \
   cmd_tokens[++cmd_tkn_index] = NULL; \
   else { token.cmd_errno = E2BIG; break; } \
   token.length = 0;}
 
 
 #define UPDATE_TOKEN {cmd_tokens[cmd_tkn_index] = strdup(token.text); \
-  NEXT_TOKEN;}
+  V_NEXT_TOKEN;}
 
 #define EOS_ERROR(x) { if (*x == 0) { token->cmd_errno = ERANGE; break; }}
 
index 564ff1aebbadb2c641e813d0790154b9570d336e..d34e8408fb304cef1a6d80f14a923377383eeef6 100644 (file)
@@ -677,7 +677,7 @@ process_begin(
         /*
          *  Set up inherited stdin, stdout, stderr for child
          */
-       memset(&startInfo, sizeof(startInfo));
+        memset(&startInfo, '\0', sizeof(startInfo));
         GetStartupInfo(&startInfo);
         startInfo.dwFlags = STARTF_USESTDHANDLES;
         startInfo.lpReserved = 0;