diff options
author | Guy Harris <guy@alum.mit.edu> | 2018-05-08 01:44:12 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2018-05-08 09:15:34 +0000 |
commit | 02a67d4e1e0828f1df17992330d9c4e02db95de5 (patch) | |
tree | f6a7c49fb6f36edd76fd944f9b9252950956f97a | |
parent | 76a29d7855f52c4c6d9bcb9747ebe285a4e85b27 (diff) |
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>
-rwxr-xr-x | tools/checkAPIs.pl | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/checkAPIs.pl b/tools/checkAPIs.pl index 9b42134dbc..725fb2b08a 100755 --- a/tools/checkAPIs.pl +++ b/tools/checkAPIs.pl @@ -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 |