Make libiberty/waitpid.c compile without warnings on MinGW
authorEli Zaretskii <eliz@gnu.org>
Wed, 31 May 2017 06:37:48 +0000 (09:37 +0300)
committerEli Zaretskii <eliz@gnu.org>
Wed, 31 May 2017 06:37:48 +0000 (09:37 +0300)
libiberty/ChangeLog:

2017-05-31  Eli Zaretskii  <eliz@gnu.org>

* waitpid.c (wait) [__MINGW32__]: Define as a macro
that calls _cwait, so that this function works on MinGW.

libiberty/ChangeLog
libiberty/waitpid.c

index f6318e2..2dd3ca7 100644 (file)
@@ -1,3 +1,8 @@
+2017-05-31  Eli Zaretskii  <eliz@gnu.org>
+
+       * waitpid.c (wait) [__MINGW32__]: Define as a macro
+       that calls _cwait, so that this function works on MinGW.
+
 2017-03-27  Pedro Alves  <palves@redhat.com>
 
        * cp-demint.c (cplus_demangle_fill_component): Handle
index fd519d7..c0e9c3e 100644 (file)
@@ -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)
 {