applied patches, but retained old behavior for win32 (where compilers
authorGraham Barr <gbarr@pobox.com>
Mon, 28 Sep 1998 09:41:49 +0000 (04:41 -0500)
committerGurusamy Sarathy <gsar@cpan.org>
Fri, 2 Oct 1998 02:21:52 +0000 (02:21 +0000)
can't read from stdin at all)
Date: Mon, 28 Sep 1998 09:41:49 -0500
Message-ID: <19980928094149.B26576@asic.sc.ti.com>
Subject: Re: 5.005_51 Errno invokes cpprun incorrectly
--
Date: Tue, 29 Sep 1998 12:35:43 -0500
Message-ID: <19980929123543.Z26576@asic.sc.ti.com>
Subject: Re: 5.005_51 Errno invokes cpprun incorrectly

p4raw-id: //depot/perl@1907

ext/Errno/Errno_pm.PL

index f4d5020..0d3ca75 100644 (file)
@@ -4,7 +4,7 @@ use strict;
 
 use vars qw($VERSION);
 
-$VERSION = "1.09";
+$VERSION = "1.111";
 
 my %err = ();
 
@@ -31,7 +31,9 @@ sub process_file {
        }     
     } else {
        unless(open(FH,"< $file")) {
-            warn "Cannot open '$file'";
+           # This file could be a temporay file created by cppstdin
+           # so only warn under -w, and return
+            warn "Cannot open '$file'" if $^W;
             return;
        }
     }
@@ -65,9 +67,14 @@ sub get_files {
        close(CPPI);
 
        # invoke CPP and read the output
-
-       open(CPPO,"$Config{cpprun} $Config{cppflags} errno.c |") or
-           die "Cannot exec $Config{cpprun}";
+       if ($^O eq 'MSWin32') {
+           open(CPPO,"$Config{cpprun} $Config{cppflags} errno.c |") or
+               die "Cannot run '$Config{cpprun} $Config{cppflags} errno.c'";
+       } else {
+           my $cpp = "$Config{cppstdin} $Config{cppflags} $Config{cppminus}";
+           open(CPPO,"$cpp < errno.c |") or
+               die "Cannot exec $cpp";
+       }
 
        my $pat;
        if ($^O eq 'MSWin32' and $Config{cc} =~ /^bcc/i) {
@@ -107,14 +114,13 @@ sub write_errno_pm {
        $cpp =~ s/sys\$input//i;
        open(CPPO,"$cpp  errno.c |") or
           die "Cannot exec $Config{cppstdin}";
-    } elsif(!$Config{'cpprun'} or $^O eq 'next') {
-       # NeXT will do syntax checking unless it is reading from stdin
+    } elsif ($^O eq 'MSWin32') {
+       open(CPPO,"$Config{cpprun} $Config{cppflags} errno.c |") or
+           die "Cannot run '$Config{cpprun} $Config{cppflags} errno.c'";
+    } else {
        my $cpp = "$Config{cppstdin} $Config{cppflags} $Config{cppminus}";
        open(CPPO,"$cpp < errno.c |")
            or die "Cannot exec $cpp";
-    } else {
-       open(CPPO,"$Config{cpprun} $Config{cppflags} errno.c |") or
-           die "Cannot exec $Config{cpprun}";
     }
 
     %err = ();