From: Richard Pospesel Subject: [PATCH 18/18] widl: add public attribute to typedefs with generated names when building typelib Message-Id: <20190606013415.23642-18-richard@torproject.org> Date: Wed, 5 Jun 2019 18:34:15 -0700 In-Reply-To: <20190606013415.23642-1-richard@torproject.org> References: <20190606013415.23642-1-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 ff3c0de3f5..66b870b4bb 100644 --- a/tools/widl/parser.y +++ b/tools/widl/parser.y @@ -2065,7 +2065,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