diff options
author | Nicholas Clark <nick@ccl4.org> | 2006-01-07 17:19:29 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2006-01-07 17:19:29 +0000 |
commit | 0e6f150f8eee9e8d89a6722ffef00c12282358f5 (patch) | |
tree | d074c5a6fe186f3b2ac2f83e93656a1ecb39245a /ext/Fcntl/Fcntl.pm | |
parent | dad67c22164b24285742ec192efc9d9c97490b77 (diff) | |
download | perl-0e6f150f8eee9e8d89a6722ffef00c12282358f5.tar.gz |
Reorder Fcntl's bootstrapping so that the constants actually get
inlined within the functions that Fcntl defines.
p4raw-id: //depot/perl@26701
Diffstat (limited to 'ext/Fcntl/Fcntl.pm')
-rw-r--r-- | ext/Fcntl/Fcntl.pm | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/ext/Fcntl/Fcntl.pm b/ext/Fcntl/Fcntl.pm index 7ef0038bd1..067c0612ef 100644 --- a/ext/Fcntl/Fcntl.pm +++ b/ext/Fcntl/Fcntl.pm @@ -60,7 +60,10 @@ our($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS, $AUTOLOAD); require Exporter; use XSLoader (); @ISA = qw(Exporter); -$VERSION = "1.05"; +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.05"; )], ); -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; |