Module: wine Branch: master Commit: e1fd4390bf7eba7de7b5c9cf039123dab992147d URL: http://source.winehq.org/git/wine.git/?a=commit;h=e1fd4390bf7eba7de7b5c9cf03...
Author: Alexandre Julliard julliard@winehq.org Date: Mon Jun 7 16:46:44 2010 +0200
winapi: Fix a few C parser bugs.
---
tools/winapi/c_parser.pm | 12 +++++++++--- 1 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/tools/winapi/c_parser.pm b/tools/winapi/c_parser.pm index 189f780..8bb40d5 100644 --- a/tools/winapi/c_parser.pm +++ b/tools/winapi/c_parser.pm @@ -513,6 +513,12 @@ sub parse_c_declaration($$$$) if(s/)//) { $column++; } + } elsif(s/^__ASM_STDCALL_FUNC(\s*(\w+)\s*,\s*\d+\s*,\s*//s) { # FIXME: Wine specific kludge + $self->_update_c_position($&, $line, $column); + $self->_parse_c_until_one_of(")", $_, $line, $column); + if(s/)//) { + $column++; + } } elsif(s/^(?:DEFINE_AVIGUID|DEFINE_OLEGUID)\s*(?=()//s) { # FIXME: Wine specific kludge $self->_update_c_position($&, $line, $column);
@@ -934,7 +940,7 @@ sub parse_c_file($$$$) $self->_parse_c_error($_, $line, $column, "file", ") without ("); } $declaration .= $&; - if($plevel == 1 && $declaration =~ /^__ASM_GLOBAL_FUNC/) { + if($plevel == 1 && $declaration =~ /^(__ASM_GLOBAL_FUNC|__ASM_STDCALL_FUNC)/) { if(!$self->parse_c_declaration($declaration, $declaration_line, $declaration_column)) { return 0; } @@ -1390,11 +1396,11 @@ sub parse_c_struct_union($$$$$$$$$)
$self->_parse_c_until_one_of("\S", $_, $line, $column);
- if (!s/^(interface|struct|union)\s+((?:MSVCRT|WS)(\s*\w+\s*)|\w+)?\s*{\s*//s) { + if (!s/^(interface|struct|union)(\s+((?:MSVCRT|WS)(\s*\w+\s*)|\w+))?\s*{\s*//s) { return 0; } $kind = $1; - $_name = $2 || ""; + $_name = $3 || "";
$self->_update_c_position($&, $line, $column);