summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig A. Berry <craigberry@mac.com>2007-05-18 21:42:56 +0000
committerCraig A. Berry <craigberry@mac.com>2007-05-18 21:42:56 +0000
commitb4ff380f20561274e4b6f0c9fde2644d95c98ac8 (patch)
tree212c8d080ae194cf9fe12af7219d74832086c3ca
parent34f7f30df6fcd985e62d43a002d5a25b03156758 (diff)
downloadperl-b4ff380f20561274e4b6f0c9fde2644d95c98ac8.tar.gz
When trimming long XS symbols on VMS, avoid warnings from operator
precedence mistakes, but for now give the same symbol mangling results as before. p4raw-id: //depot/perl@31236
-rw-r--r--vms/ext/XSSymSet.pm9
1 files changed, 4 insertions, 5 deletions
diff --git a/vms/ext/XSSymSet.pm b/vms/ext/XSSymSet.pm
index 18aa261124..5fd59e79aa 100644
--- a/vms/ext/XSSymSet.pm
+++ b/vms/ext/XSSymSet.pm
@@ -2,7 +2,7 @@ package ExtUtils::XSSymSet;
use strict;
use vars qw( $VERSION );
-$VERSION = '1.0';
+$VERSION = '1.1';
sub new {
@@ -36,9 +36,10 @@ sub trimsym {
if (length $trimmed > $maxlen) {
my $squeezed = $trimmed;
my($xs,$prefix,$func) = $trimmed =~ /^(XS_)?(.*)_([^_]*)$/;
+ $xs ||= '';
+ my $frac = 3; # replaces broken length-based calculations but w/same result
+ my $pat = '([^_])';
if (length $func <= 12) { # Try to preserve short function names
- my $frac = int(length $prefix / (length $trimmed - $maxlen) + 0.5);
- my $pat = '([^_])';
if ($frac > 1) { $pat .= '[^A-Z_]{' . ($frac - 1) . '}'; }
$prefix =~ s/$pat/$1/g;
$squeezed = "$xs$prefix" . "_$func";
@@ -49,8 +50,6 @@ sub trimsym {
}
}
else {
- my $frac = int(length $trimmed / (length $trimmed - $maxlen) + 0.5);
- my $pat = '([^_])';
if ($frac > 1) { $pat .= '[^A-Z_]{' . ($frac - 1) . '}'; }
$squeezed = "$prefix$func";
$squeezed =~ s/$pat/$1/g;