From: Richard Pospesel Subject: [PATCH 14/15] widl: add public attribute to typedefs with generated names when building typelib Message-Id: <20190705215144.7474-13-richard@torproject.org> Date: Fri, 5 Jul 2019 14:51:43 -0700 In-Reply-To: <20190705215144.7474-12-richard@torproject.org> References: <20190705215003.7384-1-richard@torproject.org> <20190705215144.7474-1-richard@torproject.org> <20190705215144.7474-2-richard@torproject.org> <20190705215144.7474-3-richard@torproject.org> <20190705215144.7474-4-richard@torproject.org> <20190705215144.7474-5-richard@torproject.org> <20190705215144.7474-6-richard@torproject.org> <20190705215144.7474-7-richard@torproject.org> <20190705215144.7474-8-richard@torproject.org> <20190705215144.7474-9-richard@torproject.org> <20190705215144.7474-10-richard@torproject.org> <20190705215144.7474-11-richard@torproject.org> <20190705215144.7474-12-richard@torproject.org> Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47050 Signed-off-by: Richard Pospesel --- tools/widl/parser.y | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/widl/parser.y b/tools/widl/parser.y index f7c51c1d64..ef8c040f37 100644 --- a/tools/widl/parser.y +++ b/tools/widl/parser.y @@ -2058,7 +2058,13 @@ static type_t *reg_typedefs(decl_spec_t *decl_spec, declarator_list_t *decls, at type_get_type_detect_alias(type) == TYPE_ENCAPSULATED_UNION) { if (!type->name) + { type->name = gen_name(); + /* the generated name will be used and this typedef excluded from the + * built typelib unless the typedef has the 'public' attribute, so add it here */ + if (do_typelib && !is_attr(attrs, ATTR_PUBLIC)) + attrs = append_attr(attrs, make_attr(ATTR_PUBLIC)); + } /* replace existing attributes when generating a typelib */ if (do_typelib) -- 2.17.1