From: Nick Ing-Simmons Date: Sun, 30 Dec 2001 14:30:02 +0000 (+0000) Subject: Win32 hides some errno-oid constants in under assumed names. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4d70086c95dd7d504d588db11daab964a36e98ee;p=p5sagit%2Fp5-mst-13.2.git Win32 hides some errno-oid constants in under assumed names. This gets them into Errno.pm - yet to prove they end up in $!. p4raw-id: //depot/perlio@13950 --- diff --git a/ext/Errno/Errno_pm.PL b/ext/Errno/Errno_pm.PL index d429146..eafbd67 100644 --- a/ext/Errno/Errno_pm.PL +++ b/ext/Errno/Errno_pm.PL @@ -5,6 +5,7 @@ use strict; our $VERSION = "1.09_00"; my %err = (); +my %wsa = (); unlink "Errno.pm" if -f "Errno.pm"; open OUT, ">Errno.pm" or die "Cannot open Errno.pm: $!"; @@ -12,6 +13,10 @@ select OUT; my $file; foreach $file (get_files()) { process_file($file); + if ($^O eq 'MSWin32') { + $file =~ s/errno/winsock/; + process_file($file); + } } write_errno_pm(); unlink "errno.c" if -f "errno.c"; @@ -20,6 +25,7 @@ sub process_file { my($file) = @_; return unless defined $file and -f $file; +# warn "Processing $file\n"; local *FH; if (($^O eq 'VMS') && ($Config{vms_cc_type} ne 'gnuc')) { @@ -55,6 +61,10 @@ sub process_file { while() { $err{$1} = 1 if /^\s*#\s*define\s+(E\w+)\s+/; + if ($^O eq 'MSWin32') { + $wsa{$1} = 1 + if /^\s*#\s*define\s+WSA(E\w+)\s+/; + } } } close(FH); @@ -172,11 +182,21 @@ sub write_errno_pm { die "Cannot open errno.c"; if ($^O eq 'NetWare') { - print CPPI "#include \n"; - } else { - print CPPI "#include \n"; + print CPPI "#include \n"; + } + else { + print CPPI "#include \n"; + } + if ($^O eq 'MSWin32') { + print CPPI "#include \n"; + foreach $err (keys %wsa) { + print CPPI "#ifndef $err\n"; + print CPPI "#define $err WSA$err\n"; + print CPPI "#endif\n"; + $err{$err} = 1; } - + } + foreach $err (keys %err) { print CPPI '"',$err,'" [[',$err,']]',"\n"; }