diff options
author | Nicholas Clark <nick@ccl4.org> | 2010-10-18 20:31:00 +0200 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2010-10-18 20:31:00 +0200 |
commit | 923cc1bb816922fc7e3d923ecac3b09efc7690cc (patch) | |
tree | 000a67a6fe25b12170472d44fb07b1e81ac1e981 /ext/Fcntl/Fcntl.pm | |
parent | 87eca6eccde7fa88e66a2fc2ad817978f8d1c549 (diff) | |
download | perl-923cc1bb816922fc7e3d923ecac3b09efc7690cc.tar.gz |
Convert Fcntl::S_IFMT to XS.
This removes the requirement to call XSLoader::load() at BEGIN time, which
simplifies the Perl code further.
Diffstat (limited to 'ext/Fcntl/Fcntl.pm')
-rw-r--r-- | ext/Fcntl/Fcntl.pm | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/ext/Fcntl/Fcntl.pm b/ext/Fcntl/Fcntl.pm index 1f6901940b..834d7ec205 100644 --- a/ext/Fcntl/Fcntl.pm +++ b/ext/Fcntl/Fcntl.pm @@ -59,10 +59,11 @@ use strict; our($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS, $AUTOLOAD); require Exporter; +require XSLoader; @ISA = qw(Exporter); -BEGIN { - $VERSION = '1.09'; -} +$VERSION = '1.09'; + +XSLoader::load(); # Items to export into callers namespace by default # (move infrequently used names to @EXPORT_OK below) @@ -209,14 +210,6 @@ BEGIN { )], ); -# Force the constants to become inlined -BEGIN { - require XSLoader; - XSLoader::load(); -} - -sub S_IFMT { @_ ? ( $_[0] & _S_IFMT() ) : _S_IFMT() } - sub AUTOLOAD { (my $constname = $AUTOLOAD) =~ s/.*:://; die "&Fcntl::constant not defined" if $constname eq 'constant'; |