Skip to content

Commit

Permalink
xsubpp incorrectly handles 'class::newthing()'
Browse files Browse the repository at this point in the history
private-msgid: 199704122201.PAA01780@jql.accessone.com
  • Loading branch information
John Q. Linux authored and Chip Salzenberg committed Apr 14, 1997
1 parent 248e2fe commit 683d4ee
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/ExtUtils/xsubpp
Expand Up @@ -821,7 +821,8 @@ while (fetch_para()) {

@args = split(/\s*,\s*/, $orig_args);
if (defined($class)) {
my $arg0 = ((defined($static) or $func_name =~ /^new/) ? "CLASS" : "THIS");
my $arg0 = ((defined($static) or $func_name eq 'new')
? "CLASS" : "THIS");
unshift(@args, $arg0);
($orig_args = "$arg0, $orig_args") =~ s/^$arg0, $/$arg0/;
}
Expand Down Expand Up @@ -928,7 +929,7 @@ EOF
EOF

if (!$thisdone && defined($class)) {
if (defined($static) or $func_name =~ /^new/) {
if (defined($static) or $func_name eq 'new') {
print "\tchar *";
$var_types{"CLASS"} = "char *";
&generate_init("char *", 1, "CLASS");
Expand Down Expand Up @@ -973,13 +974,13 @@ EOF
$wantRETVAL = 1;
}
if (defined($static)) {
if ($func_name =~ /^new/) {
if ($func_name eq 'new') {
$func_name = "$class";
} else {
print "${class}::";
}
} elsif (defined($class)) {
if ($func_name =~ /^new/) {
if ($func_name eq 'new') {
$func_name .= " $class";
} else {
print "THIS->";
Expand Down

0 comments on commit 683d4ee

Please sign in to comment.