My recent changes to POSIX.xs forgot that WEXITSTATUS etc may not even
authorNicholas Clark <nick@ccl4.org>
Sun, 25 May 2008 23:47:00 +0000 (23:47 +0000)
committerNicholas Clark <nick@ccl4.org>
Sun, 25 May 2008 23:47:00 +0000 (23:47 +0000)
be defined. This fix changes the error message from "Your vendor has
not defined POSIX macro %s, used" to "POSIX::%s not implemented on
this architecture", which I assume is not going to break anything.

p4raw-id: //depot/perl@33936

ext/POSIX/POSIX.xs

index 9c101ce..b7cdc34 100644 (file)
@@ -658,22 +658,46 @@ WEXITSTATUS(status)
     CODE:
        switch(ix) {
        case 0:
+#ifdef WEXITSTATUS
            RETVAL = WEXITSTATUS(status);
+#else
+           not_here("WEXITSTATUS");
+#endif
            break;
        case 1:
+#ifdef WIFEXITED
            RETVAL = WIFEXITED(status);
+#else
+           not_here("WIFEXITED");
+#endif
            break;
        case 2:
+#ifdef WIFSIGNALED
            RETVAL = WIFSIGNALED(status);
+#else
+           not_here("WIFSIGNALED");
+#endif
            break;
        case 3:
+#ifdef WIFSTOPPED
            RETVAL = WIFSTOPPED(status);
+#else
+           not_here("WIFSTOPPED");
+#endif
            break;
        case 4:
+#ifdef WSTOPSIG
            RETVAL = WSTOPSIG(status);
+#else
+           not_here("WSTOPSIG");
+#endif
            break;
        case 5:
+#ifdef WTERMSIG
            RETVAL = WTERMSIG(status);
+#else
+           not_here("WTERMSIG");
+#endif
            break;
        default:
            Perl_croak(aTHX_ "Illegal alias %d for POSIX::W*", ix);