From: Graham Barr Date: Mon, 28 Sep 1998 09:41:49 +0000 (-0500) Subject: applied patches, but retained old behavior for win32 (where compilers X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6ad8d9a8419883f07cb9bb1b592427ebd1ee0ef4;p=p5sagit%2Fp5-mst-13.2.git applied patches, but retained old behavior for win32 (where compilers 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 --- diff --git a/ext/Errno/Errno_pm.PL b/ext/Errno/Errno_pm.PL index f4d5020..0d3ca75 100644 --- a/ext/Errno/Errno_pm.PL +++ b/ext/Errno/Errno_pm.PL @@ -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 = ();