[PATCH 4/7] winapi_test: Escape parentheses in regexp.
Signed-off-by: Serge Gautherie <winehq-git_serge_180711(a)gautherie.fr> --- Fix parsing related to a few *_PTR types from basetsd.h. Addendum to 6b11a3c3f81d7db3794f3320eeaef8001cc99b74. --- tools/winapi/winapi_test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/winapi/winapi_test b/tools/winapi/winapi_test index 4a0a396..09c6614 100755 --- a/tools/winapi/winapi_test +++ b/tools/winapi/winapi_test @@ -419,7 +419,7 @@ foreach my $file (@files) { push @ifdefs, ($pointer_size == 8); } elsif ($preprocessor =~ /^\#\s*ifndef\s+_WIN64/) { push @ifdefs, ($pointer_size == 4); - } elsif ($preprocessor =~ /^\#\s*elif\s+defined(_WIN64)/) { + } elsif ($preprocessor =~ /^\#\s*elif\s+defined\(_WIN64\)/) { $ifdefs[$#ifdefs] = ($pointer_size == 8); } elsif ($preprocessor =~ /^\#\s*ifdef\s/) { push @ifdefs, 2; -- 2.10.0.windows.1
On Sat, 25 Jul 2020, Serge Gautherie wrote: [...]
- } elsif ($preprocessor =~ /^\#\s*elif\s+defined(_WIN64)/) { + } elsif ($preprocessor =~ /^\#\s*elif\s+defined\(_WIN64\)/) {
This also replaces a tab with spaces. Spaces are allowed around defined so you may add defensive \s*-s while you're at it: } elsif ($preprocessor =~ /^\#\s*elif\s+defined\s*\(\s*_WIN64\s*\)/) { I don't know if there are other places that would benefit from a similar treatment. -- Francois Gouget <fgouget(a)free.fr> http://fgouget.free.fr/ Advice is what we ask for when we already know the answer but wish we didn't -- Eric Jong
participants (2)
-
Francois Gouget -
Serge Gautherie