[PATCH] winapi: Ignore function declarations that are too complex.

Francois Gouget fgouget at free.fr
Tue Apr 14 09:57:00 CDT 2020


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 <fgouget at free.fr>
---
 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 b24ce5f5f33..463b40ad33b 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
-- 
2.20.1




More information about the wine-devel mailing list