From 22d27236ceb370399d8c040b2bbe02fccef6e06a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernhard=20K=C3=B6lbl?= Date: Sat, 22 Jan 2022 07:55:32 +0100 Subject: [PATCH] widl: Allow optional interface parameter on the [activatable] attribute. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As per MIDL 3.0. Needed for some WinRT runtime classes. Signed-off-by: Bernhard Kölbl Signed-off-by: Rémi Bernon Signed-off-by: Alexandre Julliard --- tools/widl/parser.y | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/widl/parser.y b/tools/widl/parser.y index b708faff6a6..c699765400b 100644 --- a/tools/widl/parser.y +++ b/tools/widl/parser.y @@ -281,6 +281,7 @@ static typelib_t *current_typelib; %type m_exprs /* exprs expr_list */ expr_list_int_const %type contract_req %type static_attr +%type activatable_attr %type delegatedef %type storage_cls_spec %type type_qualifier m_type_qual_list @@ -582,8 +583,15 @@ static_attr: decl_spec ',' contract_req { if ($1->type->type_type != TYPE_INTER $$ = make_exprt(EXPR_MEMBER, declare_var(NULL, $1, make_declarator(NULL), 0), $3); } +activatable_attr: + decl_spec ',' contract_req { if ($1->type->type_type != TYPE_INTERFACE) + error_loc("type %s is not an interface\n", $1->type->name); + $$ = make_exprt(EXPR_MEMBER, declare_var(NULL, $1, make_declarator(NULL), 0), $3); + } + | contract_req { $$ = $1; } /* activatable on the default activation factory */ + attribute: { $$ = NULL; } - | tACTIVATABLE '(' contract_req ')' { $$ = make_attrp(ATTR_ACTIVATABLE, $3); } + | tACTIVATABLE '(' activatable_attr ')' { $$ = make_attrp(ATTR_ACTIVATABLE, $3); } | tAGGREGATABLE { $$ = make_attr(ATTR_AGGREGATABLE); } | tANNOTATION '(' aSTRING ')' { $$ = make_attrp(ATTR_ANNOTATION, $3); } | tAPPOBJECT { $$ = make_attr(ATTR_APPOBJECT); }