use Config;
use File::Basename;
use File::Spec;
+use Symbol;
require Exporter;
my($XSS_work_idx, $cpp_next_tmp);
use vars qw($VERSION);
-$VERSION = '2.09_02';
-$VERSION = eval $VERSION;
+$VERSION = '2.15_02';
use vars qw(%input_expr %output_expr $ProtoUsed @InitFileCode $FH $proto_re $Overload $errors $Fallback
$cplusplus $hiertype $WantPrototypes $WantVersionChk $except $WantLineNumbers
@XSStack = ({type => 'none'});
($XSS_work_idx, $cpp_next_tmp) = (0, "XSubPPtmpAAAA");
@InitFileCode = ();
- $FH = 'File0000' ;
+ $FH = Symbol::gensym();
$proto_re = "[" . quotemeta('\$%&*@;[]') . "]" ;
$Overload = 0;
$errors = 0;
$input_expr{$key} =~ s/;*\s+\z//;
}
- my ($bal, $cast, $size);
- $bal = qr[(?:(?>[^()]+)|\((??{ $bal })\))*]; # ()-balanced
+ my ($cast, $size);
+ our $bal = qr[(?:(?>[^()]+)|\((??{ $bal })\))*]; # ()-balanced
$cast = qr[(?:\(\s*SV\s*\*\s*\)\s*)?]; # Optional (SV*) cast
$size = qr[,\s* (??{ $bal }) ]x; # Third arg (to setpvn)
)) . "|$END)\\s*:";
- my ($C_group_rex, $C_arg);
+ our ($C_group_rex, $C_arg);
# Group in C (no support for comments or literals)
$C_group_rex = qr/ [({\[]
(?: (?> [^()\[\]{}]+ ) | (??{ $C_group_rex }) )*
#XS(XS_${Full_func_name}); /* prototype to pass -Wmissing-prototypes */
#XS(XS_${Full_func_name})
#[[
+##ifdef dVAR
+# dVAR; dXSARGS;
+##else
# dXSARGS;
+##endif
EOF
print Q(<<"EOF") if $ALIAS ;
# dXSI32;
print Q(<<"EOF");
#[[
+##ifdef dVAR
+# dVAR; dXSARGS;
+##else
# dXSARGS;
+##endif
EOF
#-Wall: if there is no $Full_func_name there are no xsubs in this .xs
chdir($orig_cwd);
select($orig_fh);
untie *PSEUDO_STDOUT if tied *PSEUDO_STDOUT;
+ close $FH;
return 1;
}
Line => \@line,
LineNo => \@line_no,
Filename => $filename,
+ Filepathname => $filepathname,
Handle => $FH,
}) ;
- ++ $FH ;
+ $FH = Symbol::gensym();
# open the new file
open ($FH, "$_") or death("Cannot open '$_': $!") ;
#
EOF
- $filename = $_ ;
+ $filepathname = $filename = $_ ;
# Prime the pump by reading the first
# non-blank line
close $FH ;
$FH = $data->{Handle} ;
+ # $filename is the leafname, which for some reason isused for diagnostic
+ # messages, whereas $filepathname is the full pathname, and is used for
+ # #line directives.
$filename = $data->{Filename} ;
+ $filepathname = $data->{Filepathname} ;
$lastline = $data->{LastLine} ;
$lastline_no = $data->{LastLineNo} ;
@line = @{ $data->{Line} } ;