From 4c554940d463f57e761d951b3767ddf76330563e Mon Sep 17 00:00:00 2001 From: Francois Gouget Date: Tue, 14 Apr 2020 16:57:00 +0200 Subject: [PATCH] winapi: Ignore function declarations that are too complex. A few function declarations are simply too complex for the winapi parser. Some are because they are in fact macro calls, and other because they mix parentheses with array declarations or strange function pointer types. When that happens print an error message and ignore the function declaration. Signed-off-by: Francois Gouget Signed-off-by: Alexandre Julliard --- tools/winapi/winapi_parser.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/winapi/winapi_parser.pm b/tools/winapi/winapi_parser.pm index da0a929bf17..ca4cef4267e 100644 --- a/tools/winapi/winapi_parser.pm +++ b/tools/winapi/winapi_parser.pm @@ -492,7 +492,11 @@ sub parse_c_file($$) { # die "$file: $.: syntax error: '$argument_type':'$argument_name'\n"; } else { - die "$file: $.: syntax error: '$argument'\n"; + # This is either a complex argument type, typically + # involving parentheses, or a macro argument. This is rare + # so just ignore the 'function' declaration. + print STDERR "$file: $.: cannot parse declaration argument (ignoring): '$argument'\n"; + next readmore; } $argument_type =~ s/\s*(?:const|volatile)\s*/ /g; # Remove const/volatile