From: Nicholas Clark Date: Mon, 5 Nov 2007 12:51:39 +0000 (+0000) Subject: Allow (pedantically correct) C pre-processor comments in the code X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a396bf53e008922a27c700e1af53f555c39457a7;p=p5sagit%2Fp5-mst-13.2.git Allow (pedantically correct) C pre-processor comments in the code snippets of typemap files. p4raw-id: //depot/perl@32223 --- diff --git a/lib/ExtUtils/ParseXS.pm b/lib/ExtUtils/ParseXS.pm index 4c519fc..221d5a4 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.18_01'; +$VERSION = '2.18_02'; use vars qw(%input_expr %output_expr $ProtoUsed @InitFileCode $FH $proto_re $Overload $errors $Fallback $cplusplus $hiertype $WantPrototypes $WantVersionChk $except $WantLineNumbers @@ -195,6 +195,13 @@ sub process_file { foreach my $value (values %input_expr) { $value =~ s/;*\s+\z//; + # Move C pre-processor instructions to column 1 to be strictly ANSI + # conformant. Some pre-processors are fussy about this. + $value =~ s/^\s+#/#/mg; + } + foreach my $value (values %output_expr) { + # And again. + $value =~ s/^\s+#/#/mg; } my ($cast, $size);