=cut
# Global Constants
-$XSUBPP_version = "1.935";
+$XSUBPP_version = "1.937";
require 5.002;
use vars '$cplusplus';
$type = TidyType($type) ;
$type_kind{$type} = $kind ;
# prototype defaults to '$'
- $proto = '$' unless $proto ;
+ $proto = "\$" unless $proto ;
warn("Warning: File '$typemap' Line $. '$line' Invalid prototype '$proto'\n")
unless ValidProtoString($proto) ;
$proto_letter{$type} = C_string($proto) ;
{
my ($type) = @_ ;
- $proto_letter{$type} or '$' ;
+ $proto_letter{$type} or "\$" ;
}
sub check_cpp {
print <<EOM ;
/*
* This file was generated automatically by xsubpp version $XSUBPP_version from the
- * contents of $filename. Don't edit this file, edit $filename instead.
+ * contents of $filename. Do not edit this file, edit $filename instead.
*
* ANY CHANGES MADE HERE WILL BE LOST!
*
$defaults{$args[$i]} = $2;
$defaults{$args[$i]} =~ s/"/\\"/g;
}
- $proto_arg[$i+1] = '$' ;
+ $proto_arg[$i+1] = "\$" ;
}
if (defined($class)) {
$func_args = join(", ", @args[1..$#args]);
@args_match{@args} = 1..@args;
$PPCODE = grep(/^\s*PPCODE\s*:/, @line);
+ $CODE = grep(/^\s*CODE\s*:/, @line);
$ALIAS = grep(/^\s*ALIAS\s*:/, @line);
# print function header
# croak(errbuf);
EOF
- print Q<<EOF unless $PPCODE;
+ if ($ret_type ne "void" or $CODE) {
+ print Q<<EOF unless $PPCODE;
# XSRETURN(1);
EOF
+ } else {
+ print Q<<EOF unless $PPCODE;
+# XSRETURN_EMPTY;
+EOF
+ }
print Q<<EOF;
#]]
$subexpr =~ s/ntype/subtype/g;
$subexpr =~ s/\$arg/ST(ix_$var)/g;
$subexpr =~ s/\n\t/\n\t\t/g;
- $subexpr =~ s/is not of (.*")/[arg %d] is not of $1, ix_$var + 1/g;
+ $subexpr =~ s/is not of (.*\")/[arg %d] is not of $1, ix_$var + 1/g;
$subexpr =~ s/\$var/${var}[ix_$var - $argoff]/;
$expr =~ s/DO_ARRAY_ELEM/$subexpr/;
}
eval "print qq\a$expr\a";
}
elsif ($var eq 'RETVAL') {
- if ($expr =~ /^\t\$arg = /) {
+ if ($expr =~ /^\t\$arg\s*=\s*\$var\s*;/) {
+ eval "print qq\a$expr\a";
+ print "\tif (SvREFCNT(ST(0))) sv_2mortal(ST(0));\n";
+ }
+ elsif ($expr =~ /^\t\$arg = /) {
eval "print qq\a$expr\a";
print "\tsv_2mortal(ST(0));\n";
}