summaryrefslogtreecommitdiff
path: root/lib/ExtUtils
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2007-11-05 12:51:39 +0000
committerNicholas Clark <nick@ccl4.org>2007-11-05 12:51:39 +0000
commita396bf53e008922a27c700e1af53f555c39457a7 (patch)
treeec60584dde677ef35f93eb4f3be408013d11a87e /lib/ExtUtils
parent26f266f7047990be53d6e87dc63daa4109444b3e (diff)
downloadperl-a396bf53e008922a27c700e1af53f555c39457a7.tar.gz
Allow (pedantically correct) C pre-processor comments in the code
snippets of typemap files. p4raw-id: //depot/perl@32223
Diffstat (limited to 'lib/ExtUtils')
-rw-r--r--lib/ExtUtils/ParseXS.pm9
1 files changed, 8 insertions, 1 deletions
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);