From: Jarkko Hietaniemi Date: Mon, 4 Jun 2001 16:21:55 +0000 (+0000) Subject: The .pm changes to go with #10428. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b903fcffa3593f7d54952287ec6b5f0de94b0e94;p=p5sagit%2Fp5-mst-13.2.git The .pm changes to go with #10428. p4raw-id: //depot/perl@10431 --- diff --git a/ext/Fcntl/Fcntl.pm b/ext/Fcntl/Fcntl.pm index c68dda1..6e42367 100644 --- a/ext/Fcntl/Fcntl.pm +++ b/ext/Fcntl/Fcntl.pm @@ -60,7 +60,7 @@ our($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS, $AUTOLOAD); require Exporter; use XSLoader (); @ISA = qw(Exporter); -$VERSION = "1.03"; +$VERSION = "1.04"; # Items to export into callers namespace by default # (move infrequently used names to @EXPORT_OK below) @EXPORT = @@ -201,17 +201,11 @@ sub S_ISENFMT { ( $_[0] & _S_IFMT() ) == S_IFENFMT() } sub AUTOLOAD { (my $constname = $AUTOLOAD) =~ s/.*:://; - my $val = constant($constname); - if ($! != 0) { - if ($! =~ /Invalid/ || $!{EINVAL}) { - $AutoLoader::AUTOLOAD = $AUTOLOAD; - goto &AutoLoader::AUTOLOAD; - } - else { - my ($pack,$file,$line) = caller; - die "Your vendor has not defined Fcntl macro $constname, used at $file line $line. -"; - } + die "&Fcntl::constant not defined" if $constname eq 'constant'; + my ($error, $val) = constant($constname); + if ($error) { + my (undef,$file,$line) = caller; + die "$error at $file line $line.\n"; } *$AUTOLOAD = sub { $val }; goto &$AUTOLOAD; diff --git a/ext/Socket/Socket.pm b/ext/Socket/Socket.pm index 344c87d..2b2c03e 100644 --- a/ext/Socket/Socket.pm +++ b/ext/Socket/Socket.pm @@ -1,7 +1,7 @@ package Socket; our($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS); -$VERSION = "1.72"; +$VERSION = "1.73"; =head1 NAME @@ -329,10 +329,10 @@ sub sockaddr_un { sub AUTOLOAD { my($constname); ($constname = $AUTOLOAD) =~ s/.*:://; - my $val = constant($constname, @_ ? $_[0] : 0); - if ($! != 0) { - my ($pack,$file,$line) = caller; - croak "Your vendor has not defined Socket macro $constname, used"; + croak "&Socket::constant not defined" if $constname eq 'constant'; + my ($error, $val) = constant($constname); + if ($error) { + croak $error; } eval "sub $AUTOLOAD () { $val }"; goto &$AUTOLOAD; diff --git a/ext/Sys/Syslog/Syslog.pm b/ext/Sys/Syslog/Syslog.pm index 9c05dcd..eabf7b4 100644 --- a/ext/Sys/Syslog/Syslog.pm +++ b/ext/Sys/Syslog/Syslog.pm @@ -7,7 +7,7 @@ use Carp; @ISA = qw(Exporter DynaLoader); @EXPORT = qw(openlog closelog setlogmask syslog); @EXPORT_OK = qw(setlogsock); -$VERSION = '0.01'; +$VERSION = '0.02'; use Socket; use Sys::Hostname; @@ -119,6 +119,8 @@ EFE and the perl5-porters mailing list. Dependency on F replaced with XS code by Tom Hughes EFE. +Code for constant()s regenerated by Nicholas Clark Enick@ccl4.orgE. + =cut sub AUTOLOAD { @@ -128,10 +130,10 @@ sub AUTOLOAD { my $constname; our $AUTOLOAD; ($constname = $AUTOLOAD) =~ s/.*:://; - croak "& not defined" if $constname eq 'constant'; - my $val = constant($constname); - if ($! != 0) { - croak "Your vendor has not defined Sys::Syslog macro $constname"; + croak "&Sys::Syslog::constant not defined" if $constname eq 'constant'; + my ($error, $val) = constant($constname); + if ($error) { + croak $error; } *$AUTOLOAD = sub { $val }; goto &$AUTOLOAD;