On 09/28/2010 10:42 AM, Paul Eggert wrote:
On 09/28/10 09:34, Eric Blake wrote:
However, in thinking about it a bit more, a compromise would be to also
modify tests/test-stdlib.c to check for the presence of whether the
gnulib sys_wait module is in use, and skip validation of the
status-related macros if it is not. Then, stdlib can drop the sys_wait
dependency, and if you care about the macros, it's not that much harder
to additionally request the sys_wait module.
That would be fine, yes. The point is that we shouldn't be letting
the tail (mingw and sys/wait) wag the dog. Another possibility
would be this patch -- would you prefer that?
Hmm - this would be the first time that one of our replacement headers
#includes a non-replacement header - if someone installs
/usr/include/libposix/stdlib.h as the gnulib replacement (given the
recent work on trying to get the libposix usage of gnulib up and
running), then they also have to install sys_waitdefs.h in the same
directory. But that's not a show-stopper for me.
/* MirBSD 10 defines WEXITSTATUS in<sys/wait.h>, not in<stdlib.h>. */
#ifndef WEXITSTATUS
-# include<sys/wait.h>
+# include "sys_waitdefs.h"
#endif
I think we _still_ need to include the system <sys/wait.h> prior to
"sys_waitdefs.h". That is, sys_waitdefs.h won't define replacements on
MirBSD where the system <sys/wait.h> is adequate. And "sys_waitdefs.h"
can't include <sys/wait.h>, otherwise we have a circular loop with our
replacement <sys/wait.h> using "sys_waitdefs.h".
But other than that, this looks like it will do the trick.
--
Eric Blake ebl...@redhat.com +1-801-349-2682
Libvirt virtualization library http://libvirt.org