This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb/gdb-8.0-branch] Make libiberty/waitpid.c compile without warnings on MinGW


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=704f06fe081d9b17eb192c0db91d8367edcd6c9e

commit 704f06fe081d9b17eb192c0db91d8367edcd6c9e
Author: Eli Zaretskii <eliz@gnu.org>
Date:   Wed May 31 09:37:48 2017 +0300

    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.
    
    (cherry picked from commit 90b4491842980d57a0e572167a168e04a476bca5)

Diff:
---
 libiberty/ChangeLog | 5 +++++
 libiberty/waitpid.c | 5 +++++
 2 files changed, 10 insertions(+)

diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index f6318e2..2dd3ca7 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 fd519d7..c0e9c3e 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)
 {


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]