forked from osmocom/wireshark
Report the file name in the "#if/#endif mismatch" error.
Change-Id: I54d2b98e471e04a2ad0a8ecc036180af04bb8359 Reviewed-on: https://code.wireshark.org/review/27394 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
This commit is contained in:
parent
76a29d7855
commit
02a67d4e1e
|
@ -948,13 +948,15 @@ my $debug = 0;
|
|||
}xom;
|
||||
|
||||
($if_lvl, $if0_lvl, $if0) = (0,0,0);
|
||||
$$codeRef =~ s{ $preprocRegEx }{patsub($1,$2)}xegm;
|
||||
$$codeRef =~ s{ $preprocRegEx }{patsub($1,$2,$fileName)}xegm;
|
||||
|
||||
($debug == 2) && print "==> After Remove if0: code: [$fileName]\n$$codeRef\n===<\n";
|
||||
return $codeRef;
|
||||
}
|
||||
|
||||
sub patsub {
|
||||
my $fileName = @_[2];
|
||||
|
||||
if ($debug == 99) {
|
||||
print "-->$_[0]\n";
|
||||
(defined $_[1]) && print " >$_[1]<\n";
|
||||
|
@ -982,7 +984,7 @@ my $debug = 0;
|
|||
}
|
||||
$if_lvl -= 1;
|
||||
if ($if_lvl < 0) {
|
||||
die "patsub: #if/#endif mismatch"
|
||||
die "patsub: #if/#endif mismatch in $fileName"
|
||||
}
|
||||
}
|
||||
return $_[0]; # don't remove preprocessor lines themselves
|
||||
|
|
Loading…
Reference in New Issue