diff options
-rw-r--r-- | ChangeLog | 11 | ||||
-rwxr-xr-x | configure | 21 | ||||
-rw-r--r-- | stream.c | 6 |
3 files changed, 37 insertions, 1 deletions
@@ -1,5 +1,16 @@ 2011-10-16 Kaz Kylheku <kaz@kylheku.com> + Quick and dirty port to MinGW. + + * configure: Test for presence of <sys/wait.h> added. + Conditionally generates HAVE_SYS_WAIT variable in config.h. + + * stream.c: Include <sys/wait.h> conditionally. + (pipe_close): Do not test ermination status with WIFEXITED, etc. + if there is no <sys/wait.h> header. + +2011-10-16 Kaz Kylheku <kaz@kylheku.com> + * configure: reduced post-configure advice to just point to the INSTALL guide. @@ -838,6 +838,27 @@ else fi # +# sys/wait.h +# + +printf "Checking whether we have <sys/wait.h> ... " + +cat > conftest.c <<! +#include <sys/wait.h> + +int main(void) +{ + return 0; +} +! +if ! make conftest > conftest.err 2>&1 || ! [ -x conftest ] ; then + printf "no\n" +else + printf "yes\n" + printf "#define HAVE_SYS_WAIT 1\n" >> config.h +fi + +# # Clean up # @@ -34,8 +34,10 @@ #include <errno.h> #include <wchar.h> #include <unistd.h> -#include <sys/wait.h> #include "config.h" +#if HAVE_SYS_WAIT +#include <sys/wait.h> +#endif #include "lib.h" #include "gc.h" #include "unwind.h" @@ -247,6 +249,7 @@ static val pipe_close(val stream, val throw_on_error) uw_throwf(process_error_s, lit("unable to obtain status of command ~a: ~a/~s"), stream, num(errno), string_utf8(strerror(errno)), nao); +#ifdef HAVE_SYS_WAIT } else if (WIFEXITED(status)) { int exitstatus = WEXITSTATUS(status); uw_throwf(process_error_s, lit("pipe ~a terminated with status ~a"), @@ -263,6 +266,7 @@ static val pipe_close(val stream, val throw_on_error) } else { uw_throwf(file_error_s, lit("strange status in when closing pipe ~a"), stream, nao); +#endif } } |