diff options
author | Paul Smith <psmith@gnu.org> | 2005-02-26 01:41:48 +0000 |
---|---|---|
committer | Paul Smith <psmith@gnu.org> | 2005-02-26 01:41:48 +0000 |
commit | 9d153cc1b1e467cd6245755c32f78efbd62142c2 (patch) | |
tree | 229919252d0b4a25e1e5c00d80ab744fbe5b5c81 /w32/subproc | |
parent | 6d995b036e714ea3d61112ebc582b0671cc36e77 (diff) | |
download | gunmake-9d153cc1b1e467cd6245755c32f78efbd62142c2.tar.gz |
Add configure operations to support MINGW on Windows.
Diffstat (limited to 'w32/subproc')
-rw-r--r-- | w32/subproc/sub_proc.c | 13 | ||||
-rw-r--r-- | w32/subproc/w32err.c | 7 |
2 files changed, 13 insertions, 7 deletions
diff --git a/w32/subproc/sub_proc.c b/w32/subproc/sub_proc.c index bf1e732..63911fc 100644 --- a/w32/subproc/sub_proc.c +++ b/w32/subproc/sub_proc.c @@ -664,13 +664,13 @@ process_pipe_io( DWORD wait_return; HANDLE ready_hand; bool_t child_dead = FALSE; - + BOOL GetExitCodeResult; /* * Create stdin thread, if needed */ - pproc->inp = stdin_data; - pproc->incnt = stdin_data_len; + pproc->inp = stdin_data; + pproc->incnt = stdin_data_len; if (!pproc->inp) { stdin_eof = TRUE; CloseHandle((HANDLE)pproc->sv_stdin[0]); @@ -762,7 +762,8 @@ process_pipe_io( } else if (ready_hand == childhand) { - if (GetExitCodeProcess(childhand, &pproc->exit_code) == FALSE) { + GetExitCodeResult = GetExitCodeProcess(childhand, (DWORD*)&pproc->exit_code); + if (GetExitCodeResult == FALSE) { pproc->last_err = GetLastError(); pproc->lerrno = E_SCALL; goto done; @@ -809,6 +810,7 @@ process_file_io( sub_process *pproc; HANDLE childhand; DWORD wait_return; + BOOL GetExitCodeResult; if (proc == NULL) pproc = process_wait_for_any_private(); @@ -852,7 +854,8 @@ process_file_io( goto done2; } - if (GetExitCodeProcess(childhand, &pproc->exit_code) == FALSE) { + GetExitCodeResult = GetExitCodeProcess(childhand, (DWORD*)&pproc->exit_code); + if (GetExitCodeResult == FALSE) { pproc->last_err = GetLastError(); pproc->lerrno = E_SCALL; } diff --git a/w32/subproc/w32err.c b/w32/subproc/w32err.c index 9bfa2c4..712fccd 100644 --- a/w32/subproc/w32err.c +++ b/w32/subproc/w32err.c @@ -11,9 +11,12 @@ */
char *
map_windows32_error_to_string (DWORD ercode) {
-/* __declspec (thread) necessary if you will use multiple threads */
+/* __declspec (thread) necessary if you will use multiple threads on MSVC */
+#ifdef _MSC_VER
__declspec (thread) static char szMessageBuffer[128];
-
+#else
+static char szMessageBuffer[128];
+#endif
/* Fill message buffer with a default message in
* case FormatMessage fails
*/
|