summaryrefslogtreecommitdiff
path: root/ext/Fcntl
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2010-10-19 20:37:06 +0200
committerNicholas Clark <nick@ccl4.org>2010-10-21 08:42:17 +0200
commit735631af6fd7ee0a0db0185decce87cabe3eb134 (patch)
tree8426e00ceac5388b565b31b455909c404c6f0ce6 /ext/Fcntl
parent04777d295957ad270188e4debf51b523e07cc5b0 (diff)
downloadperl-735631af6fd7ee0a0db0185decce87cabe3eb134.tar.gz
Convert Fcntl, File::Glob, I18N::Langinfo, POSIX and Socket to croak_on_error.
This is possible because all 5 use ExtUtils::Constant::ProxySubs, so the constant() routine is only used for error conditions.
Diffstat (limited to 'ext/Fcntl')
-rw-r--r--ext/Fcntl/Fcntl.pm9
-rw-r--r--ext/Fcntl/Makefile.PL4
2 files changed, 3 insertions, 10 deletions
diff --git a/ext/Fcntl/Fcntl.pm b/ext/Fcntl/Fcntl.pm
index 970735cd4e..6e1c1afdcd 100644
--- a/ext/Fcntl/Fcntl.pm
+++ b/ext/Fcntl/Fcntl.pm
@@ -186,14 +186,7 @@ XSLoader::load();
sub AUTOLOAD {
(my $constname = $AUTOLOAD) =~ s/.*:://;
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";
- }
- no strict 'refs';
- *$AUTOLOAD = sub { $val };
- goto &$AUTOLOAD;
+ constant($constname);
}
1;
diff --git a/ext/Fcntl/Makefile.PL b/ext/Fcntl/Makefile.PL
index 2bed7547a1..470291ffa3 100644
--- a/ext/Fcntl/Makefile.PL
+++ b/ext/Fcntl/Makefile.PL
@@ -1,5 +1,5 @@
use ExtUtils::MakeMaker;
-use ExtUtils::Constant 0.11 'WriteConstants';
+use ExtUtils::Constant 0.23 'WriteConstants';
WriteMakefile(
NAME => 'Fcntl',
XSPROTOARG => '-noprototypes', # XXX remove later?
@@ -39,7 +39,7 @@ my @names = (qw(
{name=>"SEEK_END", default=>["IV", "2"]},
{name=>"_S_IFMT", macro=>"S_IFMT", value=>"S_IFMT"});
WriteConstants(
- PROXYSUBS => 1,
+ PROXYSUBS => {croak_on_error => 1},
NAME => 'Fcntl',
NAMES => \@names,
);