Francois Gouget : winapi: Ignore function declarations that are too complex.

Alexandre Julliard julliard at winehq.org
Tue Apr 14 16:15:27 CDT 2020


Module: wine
Branch: master
Commit: 4c554940d463f57e761d951b3767ddf76330563e
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=4c554940d463f57e761d951b3767ddf76330563e

Author: Francois Gouget <fgouget at free.fr>
Date:   Tue Apr 14 16:57:00 2020 +0200

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 <fgouget at free.fr>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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 da0a929bf1..ca4cef4267 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




More information about the wine-cvs mailing list