This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: MinGW compilation warnings in libiberty's waitpid.c
- From: Eli Zaretskii <eliz at gnu dot org>
- To: DJ Delorie <dj at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org, gdb-patches at sourceware dot org
- Date: Tue, 23 May 2017 22:24:46 +0300
- Subject: Re: MinGW compilation warnings in libiberty's waitpid.c
- Authentication-results: sourceware.org; auth=none
- References: <xnk258hebj.fsf@greed.delorie.com>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> From: DJ Delorie <dj@redhat.com>
> Cc: gcc-patches@gcc.gnu.org, gdb-patches@sourceware.org
> Date: Mon, 22 May 2017 15:38:40 -0400
>
> Since (or "if") nobody will (should) use waitpid() on mingw anyway, and
> since libiberty really wants to include waitpid.o, how difficult would
> it be to use some #ifdefs to have waitpid() just return an error on
> mingw? That at least gets past the mingw build problem.
Instead of making waitpid an always-failing stub on MinGW, wouldn't it
be better to make it work on MinGW? Like this:
--- libiberty/waitpid.c~0 2016-08-01 18:50:21.000000000 +0300
+++ libiberty/waitpid.c 2017-05-23 21:19:34.302415000 +0300
@@ -23,6 +23,11 @@ does the return value. The third argume
#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)
{