X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=ext%2FFcntl%2FFcntl.pm;h=067c0612efd8d6a2201386be291021a96a903476;hb=2a5d9b1d41e4bafaa26126c5dea2f6ff0b72b6a7;hp=5153ad5393ecbfcd5c945ffd8bd3f664711b5038;hpb=5bb8c70c2ff9c8cebdb4ca9f0938da9451a2c4c9;p=p5sagit%2Fp5-mst-13.2.git diff --git a/ext/Fcntl/Fcntl.pm b/ext/Fcntl/Fcntl.pm index 5153ad5..067c061 100644 --- a/ext/Fcntl/Fcntl.pm +++ b/ext/Fcntl/Fcntl.pm @@ -11,8 +11,8 @@ Fcntl - load the C Fcntl.h defines =head1 DESCRIPTION -This module is just a translation of the C F file. -Unlike the old mechanism of requiring a translated F +This module is just a translation of the C F file. +Unlike the old mechanism of requiring a translated F file, this uses the B program (see the Perl source distribution) and your native C compiler. This means that it has a far more likely chance of getting the numbers right. @@ -60,7 +60,10 @@ our($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS, $AUTOLOAD); require Exporter; use XSLoader (); @ISA = qw(Exporter); -$VERSION = "1.04"; +BEGIN { + $VERSION = "1.05"; +} + # Items to export into callers namespace by default # (move infrequently used names to @EXPORT_OK below) @EXPORT = @@ -206,18 +209,23 @@ $VERSION = "1.04"; )], ); -sub S_IFMT { @_ ? ( $_[0] & _S_IFMT() ) : _S_IFMT() } +# Force the constants to become inlined +BEGIN { + XSLoader::load 'Fcntl', $VERSION; +} + +sub S_IFMT { @_ ? ( $_[0] & _S_IFMT ) : _S_IFMT } sub S_IMODE { $_[0] & 07777 } -sub S_ISREG { ( $_[0] & _S_IFMT() ) == S_IFREG() } -sub S_ISDIR { ( $_[0] & _S_IFMT() ) == S_IFDIR() } -sub S_ISLNK { ( $_[0] & _S_IFMT() ) == S_IFLNK() } -sub S_ISSOCK { ( $_[0] & _S_IFMT() ) == S_IFSOCK() } -sub S_ISBLK { ( $_[0] & _S_IFMT() ) == S_IFBLK() } -sub S_ISCHR { ( $_[0] & _S_IFMT() ) == S_IFCHR() } -sub S_ISFIFO { ( $_[0] & _S_IFMT() ) == S_IFIFO() } -sub S_ISWHT { ( $_[0] & _S_IFMT() ) == S_IFWHT() } -sub S_ISENFMT { ( $_[0] & _S_IFMT() ) == S_IFENFMT() } +sub S_ISREG { ( $_[0] & _S_IFMT ) == S_IFREG } +sub S_ISDIR { ( $_[0] & _S_IFMT ) == S_IFDIR } +sub S_ISLNK { ( $_[0] & _S_IFMT ) == S_IFLNK } +sub S_ISSOCK { ( $_[0] & _S_IFMT ) == S_IFSOCK } +sub S_ISBLK { ( $_[0] & _S_IFMT ) == S_IFBLK } +sub S_ISCHR { ( $_[0] & _S_IFMT ) == S_IFCHR } +sub S_ISFIFO { ( $_[0] & _S_IFMT ) == S_IFIFO } +sub S_ISWHT { ( $_[0] & _S_IFMT ) == S_IFWHT } +sub S_ISENFMT { ( $_[0] & _S_IFMT ) == S_IFENFMT } sub AUTOLOAD { (my $constname = $AUTOLOAD) =~ s/.*:://; @@ -231,6 +239,4 @@ sub AUTOLOAD { goto &$AUTOLOAD; } -XSLoader::load 'Fcntl', $VERSION; - 1;