diff options
author | Eli Zaretskii <eliz@gnu.org> | 2017-05-31 09:37:48 +0300 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2017-05-31 09:37:48 +0300 |
commit | 90b4491842980d57a0e572167a168e04a476bca5 (patch) | |
tree | ba5f613ef05675c2e1406896e52c361de37b463c | |
parent | Fix MinGW compilation warnings due to environ.h (diff) | |
download | binutils-gdb-90b4491842980d57a0e572167a168e04a476bca5.tar.gz binutils-gdb-90b4491842980d57a0e572167a168e04a476bca5.tar.bz2 binutils-gdb-90b4491842980d57a0e572167a168e04a476bca5.zip |
Make libiberty/waitpid.c compile without warnings on MinGW
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.
-rw-r--r-- | libiberty/ChangeLog | 5 | ||||
-rw-r--r-- | libiberty/waitpid.c | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index f6318e2acf2..2dd3ca7203c 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -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 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) { |