From a396bf53e008922a27c700e1af53f555c39457a7 Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Mon, 5 Nov 2007 12:51:39 +0000 Subject: [PATCH] Allow (pedantically correct) C pre-processor comments in the code snippets of typemap files. p4raw-id: //depot/perl@32223 --- lib/ExtUtils/ParseXS.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/ExtUtils/ParseXS.pm b/lib/ExtUtils/ParseXS.pm index 4c519fc8fa..221d5a43b8 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); -- 2.34.1