aboutsummaryrefslogtreecommitdiff
path: root/libiberty
diff options
context:
space:
mode:
authordj <dj@138bc75d-0d04-0410-961f-82ee72b054a4>2017-05-24 21:35:59 +0000
committerdj <dj@138bc75d-0d04-0410-961f-82ee72b054a4>2017-05-24 21:35:59 +0000
commit61998ffb2944d1abb5f7d3a1eee0a38c7eb5e420 (patch)
treece20cd8116b999b1b32da59a668f424e7f2731c9 /libiberty
parent01e91138b88a77434927fca9485e28881f52a6a0 (diff)
2017-05-24 Eli Zaretskii <eliz@gnu.org>
* libiberty/waitpid.c (wait) [__MINGW32__]: Define as a macro that calls _cwait, so that this function works on MinGW. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@248430 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libiberty')
-rw-r--r--libiberty/ChangeLog5
-rw-r--r--libiberty/waitpid.c5
2 files changed, 10 insertions, 0 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index 14e7e3258f9..c779928934a 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,8 @@
+2017-05-24 Eli Zaretskii <eliz@gnu.org>
+
+ * waitpid.c (wait) [__MINGW32__]: Define as a macro
+ that calls _cwait, so that this function works on MinGW.
+
2017-05-02 Iain Buclaw <ibuclaw@gdcproject.org>
* d-demangle.c (dlang_hexdigit): New function.
diff --git a/libiberty/waitpid.c b/libiberty/waitpid.c
index fd519d7696e..c0e9c3e0ca9 100644
--- a/libiberty/waitpid.c
+++ b/libiberty/waitpid.c
@@ -23,6 +23,11 @@ does the return value. The third argument is unused in @libib{}.
#include <sys/wait.h>
#endif
+#ifdef __MINGW32__
+#include <process.h>
+#define wait(s) _cwait(s,pid,_WAIT_CHILD)
+#endif
+
pid_t
waitpid (pid_t pid, int *stat_loc, int options ATTRIBUTE_UNUSED)
{