+
+/* Try the approach recommended by autoconf. If this doesn't cause
+ trouble anywhere, remove the original code, which is #if'd out
+ below. */
+
+#if 1
+#include <sys/types.h>
+
+#ifdef HAVE_SYS_WAIT_H /* We have sys/wait.h with POSIXoid definitions. */
+
+#include <sys/wait.h>
+#ifndef WCOREDUMP /* not POSIX */
+#define WCOREDUMP(status) ((status) & 0x80)
+#endif
+
+#else /* !HAVE_SYS_WAIT_H */
+
+/* Note that sys/wait.h may still be included by stdlib.h or something
+ according to XPG. */
+
+#undef WEXITSTATUS
+#define WEXITSTATUS(status) (((status) & 0xff00) >> 8)
+#undef WIFEXITED
+#define WIFEXITED(status) (WTERMSIG(status) == 0)
+#undef WIFSTOPPED
+#define WIFSTOPPED(status) (((status) & 0xff) == 0x7f)
+#undef WIFSIGNALED
+#define WIFSIGNALED(status) (!WIFSTOPPED(status) && !WIFEXITED(status))
+#undef WSTOPSIG
+#define WSTOPSIG(status) WEXITSTATUS(status)
+#undef WTERMSIG
+#define WTERMSIG(status) ((status) & 0x7f)
+#undef WCOREDUMP
+#define WCOREDUMP(status) ((status) & 0x80)
+#endif /* HAVE_SYS_WAIT_H */
+
+#undef WAITTYPE
+#define WAITTYPE int
+#undef WRETCODE
+#define WRETCODE(status) WEXITSTATUS (status)
+
+#else /* !1 */
+