* job.c (pid2str): Do not limit %Id to gcc >= 4 because
gcc-3.4.5 from mingw.org understands %Id just fine, and the
__GNUC__ > 3 condition also eliminates the possibility of MSVC
compiler being in use.
(exec_command): Cast hWaitPID to pid_t which is what pid2str()
accepts, instead of DWORD_PTR.

* main.c (main, ADD_SIG): Pacify compiler.

* make.h: Move malloc.h include for WINDOWS32 to an earlier
place among the alloca ifdefs.
(w32_kill): Update prototype to match what is in job.c.

* w32/subproc/sub_proc.c: For MSVC, include stddef.h instead
of stdint.h for intptr_t.

* getopt.c (_getopt_initialize): Pacify compiler (unused argc
and argv) when not building for glibc.
(_getopt_internal): Add braces around if to avoid ambigous else.

[Note: the malloc.h include changes suggested for make.h won't
be necessary if the alloca ifdefs there goes back to the state
of make-3.81.]

Index: job.c
===================================================================
RCS file: /sources/make/make/job.c,v
retrieving revision 1.203
diff -u -p -r1.203 job.c
--- job.c	9 Jul 2010 11:10:04 -0000	1.203
+++ job.c	9 Jul 2010 13:03:16 -0000
@@ -192,7 +192,7 @@ static const char *
 pid2str (pid_t pid)
 {
   static char pidstring[100];
-#if defined(WINDOWS32) && __GNUC__ > 3
+#ifdef WINDOWS32
   sprintf (pidstring, "%Id", pid);
 #else
   sprintf (pidstring, "%lu", (unsigned long) pid);
@@ -2069,11 +2069,11 @@ exec_command (char **argv, char **envp)
           break;
       else
 	{
-	  char *pidstr = xstrdup (pid2str ((DWORD_PTR)hWaitPID));
+	  char *pidstr = xstrdup (pid2str ((pid_t)hWaitPID));
 
           fprintf(stderr,
                   _("make reaped child pid %s, still waiting for pid %s\n"),
-		  pidstr, pid2str ((DWORD_PTR)hPID));
+		  pidstr, pid2str ((pid_t)hPID));
 	  free (pidstr);
 	}
     }
Index: main.c
===================================================================
RCS file: /sources/make/make/main.c,v
retrieving revision 1.240
diff -u -p -r1.240 main.c
--- main.c	9 Jul 2010 11:10:04 -0000	1.240
+++ main.c	9 Jul 2010 13:03:17 -0000
@@ -980,7 +980,7 @@ main (int argc, char **argv, char **envp
   fatal_signal_mask = 0;
 #define	ADD_SIG(sig)	fatal_signal_mask |= sigmask (sig)
 #else
-#define	ADD_SIG(sig)
+#define	ADD_SIG(sig)	(void)sig
 #endif
 #endif
 
Index: make.h
===================================================================
RCS file: /sources/make/make/make.h,v
retrieving revision 1.138
diff -u -p -r1.138 make.h
--- make.h	1 Jul 2010 05:59:09 -0000	1.138
+++ make.h	9 Jul 2010 13:03:17 -0000
@@ -31,6 +31,8 @@ this program.  If not, see <http://www.g
 /* AIX requires this to be the first thing in the file.  */
 #if HAVE_ALLOCA_H
 # include <alloca.h>
+#elif defined(_WIN32)
+# include <malloc.h>
 #else
 # ifdef _AIX
  #pragma alloca
@@ -321,12 +323,11 @@ char *strsignal (int signum);
 
 #ifdef WINDOWS32
 # include <fcntl.h>
-# include <malloc.h>
 # define pipe(_p)        _pipe((_p), 512, O_BINARY)
 # define kill(_pid,_sig) w32_kill((_pid),(_sig))
 
 void sync_Path_environment (void);
-int w32_kill (int pid, int sig);
+int w32_kill (pid_t pid, int sig);
 char *end_of_token_w32 (const char *s, char stopchar);
 int find_and_set_default_shell (const char *token);
 
Index: w32/subproc/sub_proc.c
===================================================================
RCS file: /sources/make/make/w32/subproc/sub_proc.c,v
retrieving revision 1.22
diff -u -p -r1.22 sub_proc.c
--- w32/subproc/sub_proc.c	9 Jul 2010 12:05:10 -0000	1.22
+++ w32/subproc/sub_proc.c	9 Jul 2010 13:03:19 -0000
@@ -17,7 +17,11 @@ this program.  If not, see <http://www.g
 
 #include <stdlib.h>
 #include <stdio.h>
+#ifdef _MSC_VER
+#include <stddef.h>   /* for intptr_t */
+#else
 #include <stdint.h>
+#endif
 #include <process.h>  /* for msvc _beginthreadex, _endthreadex */
 #include <signal.h>
 #include <windows.h>
Index: getopt.c
===================================================================
RCS file: /sources/make/make/getopt.c,v
retrieving revision 1.22
diff -u -p -r1.22 getopt.c
--- getopt.c	25 Oct 2009 18:56:45 -0000	1.22
+++ getopt.c	5 Jul 2010 20:05:22 -0000
@@ -436,6 +436,9 @@ _getopt_initialize (int argc, char *cons
     }
   else
     nonoption_flags_len = 0;
+#else
+  (void)argc;
+  (void)argv;
 #endif
 
   return optstring;
@@ -678,7 +681,7 @@ _getopt_internal (int argc, char *const 
 		optarg = nameend + 1;
 	      else
 		{
-		  if (opterr)
+		  if (opterr) {
 		   if (argv[optind - 1][1] == '-')
 		    /* --option */
 		    fprintf (stderr,
@@ -689,7 +692,7 @@ _getopt_internal (int argc, char *const 
 		    fprintf (stderr,
 		     _("%s: option `%c%s' doesn't allow an argument\n"),
 		     argv[0], argv[optind - 1][0], pfound->name);
-
+		  }
 		  nextchar += strlen (nextchar);
 
 		  optopt = pfound->val;
