diff options
Diffstat (limited to 'win32')
-rw-r--r-- | win32/makefile.mk | 4 | ||||
-rw-r--r-- | win32/win32.c | 17 |
2 files changed, 14 insertions, 7 deletions
diff --git a/win32/makefile.mk b/win32/makefile.mk index bb87b58269..b48ba1ec4c 100644 --- a/win32/makefile.mk +++ b/win32/makefile.mk @@ -325,7 +325,7 @@ LIBFILES = $(CRYPT_LIB) -ladvapi32 -luser32 -lnetapi32 -lwsock32 \ -lmingw32 -lgcc -lmoldname $(LIBC) -lkernel32 .IF "$(CFG)" == "Debug" -OPTIMIZE = -g -O2 $(RUNTIME) -DDEBUGGING +OPTIMIZE = -g $(RUNTIME) -DDEBUGGING LINK_DBG = -g .ELSE OPTIMIZE = -g -O2 $(RUNTIME) @@ -896,7 +896,7 @@ $(PERLDLL): perldll.def $(PERLDLL_OBJ) $(LINK32) -mdll -o $@ -Wl,--base-file -Wl,perl.base $(LINK_FLAGS) \ $(mktmp $(LKPRE) $(PERLDLL_OBJ:s,\,\\) $(LIBFILES) $(LKPOST)) dlltool --output-lib $(PERLIMPLIB) \ - --dllname perl.dll \ + --dllname $(PERLDLL:b).dll \ --def perldll.def \ --base-file perl.base \ --output-exp perl.exp diff --git a/win32/win32.c b/win32/win32.c index efb52d92a9..52692d797f 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -66,7 +66,11 @@ int _CRT_glob = 0; #endif -#ifdef __BORLANDC__ +#if defined(__MINGW32__) +# define _stat stat +#endif + +#if defined(__BORLANDC__) # define _stat stat # define _utimbuf utimbuf #endif @@ -2553,7 +2557,7 @@ win32_spawnvp(int mode, const char *cmdname, const char *const *argv) return spawnvp(mode, cmdname, (char * const *)argv); #else dTHXo; - DWORD ret; + int ret; void* env; char* dir; STARTUPINFO StartupInfo; @@ -2630,12 +2634,15 @@ RETRY: if (mode == P_NOWAIT) { /* asynchronous spawn -- store handle, return PID */ w32_child_handles[w32_num_children] = ProcessInformation.hProcess; - ret = w32_child_pids[w32_num_children] = ProcessInformation.dwProcessId; + w32_child_pids[w32_num_children] = ProcessInformation.dwProcessId; + ret = (int)ProcessInformation.dwProcessId; ++w32_num_children; } else { + DWORD status; WaitForSingleObject(ProcessInformation.hProcess, INFINITE); - GetExitCodeProcess(ProcessInformation.hProcess, &ret); + GetExitCodeProcess(ProcessInformation.hProcess, &status); + ret = (int)status; CloseHandle(ProcessInformation.hProcess); } @@ -2646,7 +2653,7 @@ RETVAL: PerlEnv_free_childdir(dir); Safefree(cmd); Safefree(fullcmd); - return (int)ret; + return ret; #endif } |