From 923cc1bb816922fc7e3d923ecac3b09efc7690cc Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Mon, 18 Oct 2010 20:31:00 +0200 Subject: Convert Fcntl::S_IFMT to XS. This removes the requirement to call XSLoader::load() at BEGIN time, which simplifies the Perl code further. --- ext/Fcntl/Fcntl.pm | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'ext/Fcntl/Fcntl.pm') 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'; -- cgit v1.2.1