diff -urNp make-cvs~/function.c make-cvs/function.c
--- make-cvs~/function.c	2009-10-25 20:56:44.000000000 +0200
+++ make-cvs/function.c	2009-10-26 10:01:34.000000000 +0200
@@ -1434,7 +1434,7 @@ int shell_function_pid = 0, shell_functi
 
 
 void
-windows32_openpipe (int *pipedes, int *pid_p, char **command_argv, char **envp)
+windows32_openpipe (int *pipedes, pid_t *pid_p, char **command_argv, char **envp)
 {
   SECURITY_ATTRIBUTES saAttr;
   HANDLE hIn;
@@ -1489,13 +1489,13 @@ windows32_openpipe (int *pipedes, int *p
     process_register(hProcess);
 
     /* set the pid for returning to caller */
-    *pid_p = (int) hProcess;
+    *pid_p = (pid_t) hProcess;
 
   /* set up to read data from child */
-  pipedes[0] = _open_osfhandle((long) hChildOutRd, O_RDONLY);
+  pipedes[0] = _open_osfhandle((intptr_t) hChildOutRd, O_RDONLY);
 
   /* this will be closed almost right away */
-  pipedes[1] = _open_osfhandle((long) hChildOutWr, O_APPEND);
+  pipedes[1] = _open_osfhandle((intptr_t) hChildOutWr, O_APPEND);
   } else {
     /* reap/cleanup the failed process */
 	process_cleanup(hProcess);
@@ -1510,7 +1510,7 @@ windows32_openpipe (int *pipedes, int *p
 
     /* set status for return */
     pipedes[0] = pipedes[1] = -1;
-    *pid_p = -1;
+    *pid_p = (pid_t) -1;
   }
 }
 #endif
@@ -1594,7 +1594,7 @@ func_shell (char *o, char **argv, const 
   const char *error_prefix;
   char **envp;
   int pipedes[2];
-  int pid;
+  pid_t pid;
 
 #ifndef __MSDOS__
   /* Construct the argument list.  */
diff -urNp make-cvs~/job.c make-cvs/job.c
--- make-cvs~/job.c	2009-10-25 03:46:52.000000000 +0300
+++ make-cvs/job.c	2009-10-26 10:09:32.000000000 +0200
@@ -233,7 +233,7 @@ unsigned int jobserver_tokens = 0;
  * The macro which references this function is defined in make.h.
  */
 int
-w32_kill(int pid, int sig)
+w32_kill(pid_t pid, int sig)
 {
   return ((process_kill((HANDLE)pid, sig) == TRUE) ? 0 : -1);
 }
@@ -301,7 +301,7 @@ create_batch_file (char const *base, int
           const unsigned final_size = path_size + size + 1;
           char *const path = xmalloc (final_size);
           memcpy (path, temp_path, final_size);
-          *fd = _open_osfhandle ((long)h, 0);
+          *fd = _open_osfhandle ((intptr_t)h, 0);
           if (unixy)
             {
               char *p;
@@ -1382,7 +1382,7 @@ start_job_command (struct child *child)
       hPID = process_easy(argv, child->environment);
 
       if (hPID != INVALID_HANDLE_VALUE)
-        child->pid = (int) hPID;
+        child->pid = (pid_t) hPID;
       else {
         int i;
         unblock_sigs();
diff -urNp make-cvs~/make.h make-cvs/make.h
--- make-cvs~/make.h	2009-10-25 20:56:45.000000000 +0200
+++ make-cvs/make.h	2009-10-26 10:16:59.000000000 +0200
@@ -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
@@ -326,7 +328,7 @@ char *strsignal (int signum);
 # 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);
 
diff -urNp make-cvs~/w32/subproc/sub_proc.c make-cvs/w32/subproc/sub_proc.c
--- make-cvs~/w32/subproc/sub_proc.c	2009-10-25 20:56:46.000000000 +0200
+++ make-cvs/w32/subproc/sub_proc.c	2009-10-26 09:51:47.000000000 +0200
@@ -31,9 +31,9 @@ static char *make_command_line(char *she
 extern char *xmalloc (unsigned int);
 
 typedef struct sub_process_t {
-	int sv_stdin[2];
-	int sv_stdout[2];
-	int sv_stderr[2];
+	intptr_t sv_stdin[2];
+	intptr_t sv_stdout[2];
+	intptr_t sv_stderr[2];
 	int using_pipes;
 	char *inp;
 	DWORD incnt;
@@ -41,7 +41,7 @@ typedef struct sub_process_t {
 	volatile DWORD outcnt;
 	char * volatile errp;
 	volatile DWORD errcnt;
-	int pid;
+	pid_t pid;
 	int exit_code;
 	int signal;
 	long last_err;
@@ -310,12 +310,12 @@ process_init()
 		pproc->lerrno = E_SCALL;
 		return((HANDLE)pproc);
 	}
-	pproc->sv_stdin[0]  = (int) stdin_pipes[0];
-	pproc->sv_stdin[1]  = (int) stdin_pipes[1];
-	pproc->sv_stdout[0] = (int) stdout_pipes[0];
-	pproc->sv_stdout[1] = (int) stdout_pipes[1];
-	pproc->sv_stderr[0] = (int) stderr_pipes[0];
-	pproc->sv_stderr[1] = (int) stderr_pipes[1];
+	pproc->sv_stdin[0]  = (intptr_t) stdin_pipes[0];
+	pproc->sv_stdin[1]  = (intptr_t) stdin_pipes[1];
+	pproc->sv_stdout[0] = (intptr_t) stdout_pipes[0];
+	pproc->sv_stdout[1] = (intptr_t) stdout_pipes[1];
+	pproc->sv_stderr[0] = (intptr_t) stderr_pipes[0];
+	pproc->sv_stderr[1] = (intptr_t) stderr_pipes[1];
 
 	pproc->using_pipes = 1;
 
@@ -337,9 +337,9 @@ process_init_fd(HANDLE stdinh, HANDLE st
 	 * Just pass the provided file handles to the 'child side' of the
 	 * pipe, bypassing pipes altogether.
 	 */
-	pproc->sv_stdin[1]  = (int) stdinh;
-	pproc->sv_stdout[1] = (int) stdouth;
-	pproc->sv_stderr[1] = (int) stderrh;
+	pproc->sv_stdin[1]  = (intptr_t) stdinh;
+	pproc->sv_stdout[1] = (intptr_t) stdouth;
+	pproc->sv_stderr[1] = (intptr_t) stderrh;
 
 	pproc->last_err = pproc->lerrno = 0;
 
@@ -575,7 +575,7 @@ process_begin(
 		}
 	}
 
-	pproc->pid = (int)procInfo.hProcess;
+	pproc->pid = (pid_t)procInfo.hProcess;
 	/* Close the thread handle -- we'll just watch the process */
 	CloseHandle(procInfo.hThread);
 
