From: Nicholas Clark Date: Fri, 23 Dec 2005 13:54:37 +0000 (+0000) Subject: ExtUtils::ParseXS needs to stack $filepathname to make #line directives X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d724ebe149a7174284557fb97f2e6c50c9bd0a9a;p=p5sagit%2Fp5-mst-13.2.git ExtUtils::ParseXS needs to stack $filepathname to make #line directives in #INCLUDEs work. p4raw-id: //depot/perl@26473 --- diff --git a/lib/ExtUtils/ParseXS.pm b/lib/ExtUtils/ParseXS.pm index 6aca644..e2bce12 100644 --- a/lib/ExtUtils/ParseXS.pm +++ b/lib/ExtUtils/ParseXS.pm @@ -18,7 +18,7 @@ my(@XSStack); # Stack of conditionals and INCLUDEs my($XSS_work_idx, $cpp_next_tmp); use vars qw($VERSION); -$VERSION = '2.15'; +$VERSION = '2.15_01'; use vars qw(%input_expr %output_expr $ProtoUsed @InitFileCode $FH $proto_re $Overload $errors $Fallback $cplusplus $hiertype $WantPrototypes $WantVersionChk $except $WantLineNumbers @@ -1438,6 +1438,7 @@ sub INCLUDE_handler () Line => \@line, LineNo => \@line_no, Filename => $filename, + Filepathname => $filepathname, Handle => $FH, }) ; @@ -1452,7 +1453,7 @@ sub INCLUDE_handler () # EOF - $filename = $_ ; + $filepathname = $filename = $_ ; # Prime the pump by reading the first # non-blank line @@ -1481,7 +1482,11 @@ sub PopFile() 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} } ;