diff --git a/tools/widl/parser.y b/tools/widl/parser.y index 8e0ff865c76..45fbd822c36 100644 --- a/tools/widl/parser.y +++ b/tools/widl/parser.y @@ -1676,8 +1676,7 @@ static type_t *reg_typedefs(type_t *type, declarator_list_t *decls, attr_list_t /* We must generate names for tagless enum, struct or union. Typedef-ing a tagless enum, struct or union means we want the typedef - to be included in a library whether it has other attributes or not, - hence the public attribute. */ + to be included in a library hence the public attribute. */ if ((type->kind == TKIND_ENUM || type->kind == TKIND_RECORD || type->kind == TKIND_UNION) && ! type->name && ! parse_only) { @@ -1685,6 +1684,8 @@ static type_t *reg_typedefs(type_t *type, declarator_list_t *decls, attr_list_t attrs = append_attr( attrs, make_attr(ATTR_PUBLIC) ); type->name = gen_name(); } + else if (is_attr(attrs, ATTR_UUID) && !is_attr(attrs, ATTR_PUBLIC)) + attrs = append_attr( attrs, make_attr(ATTR_PUBLIC) ); LIST_FOR_EACH_ENTRY( decl, decls, const declarator_t, entry ) { @@ -2650,7 +2651,7 @@ static statement_t *process_typedefs(declarator_list_t *decls) if (! parse_only && do_header) write_typedef(type); - if (in_typelib && type->attrs) + if (in_typelib && is_attr(type->attrs, ATTR_PUBLIC)) add_typelib_entry(type); type_list = &(*type_list)->next; diff --git a/tools/widl/typelib.c b/tools/widl/typelib.c index cd1c69b9ae9..70007887c7b 100644 --- a/tools/widl/typelib.c +++ b/tools/widl/typelib.c @@ -173,7 +173,7 @@ unsigned short get_type_vt(type_t *t) if (vt) return vt; } - if (t->kind == TKIND_ALIAS && t->attrs) + if (t->kind == TKIND_ALIAS && is_attr(t->attrs, ATTR_PUBLIC)) return VT_USERDEFINED; switch (t->type) { diff --git a/tools/widl/write_msft.c b/tools/widl/write_msft.c index f040dbe38d0..35c1f052381 100644 --- a/tools/widl/write_msft.c +++ b/tools/widl/write_msft.c @@ -962,8 +962,8 @@ static int encode_type( { int typeinfo_offset; - /* typedef'd types without attributes aren't included in the typelib */ - while (type->typelib_idx < 0 && type->kind == TKIND_ALIAS && ! type->attrs) + /* typedef'd types without public attribute aren't included in the typelib */ + while (type->typelib_idx < 0 && type->kind == TKIND_ALIAS && !is_attr(type->attrs, ATTR_PUBLIC)) type = type->orig; chat("encode_type: VT_USERDEFINED - type %p name = %s type->type %d idx %d\n", type,