Commit 80be9df3 authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

widl: Add typedefs to typelibs which have the public or uuid attributes, not any other attribute.

parent 1d70c7ad
......@@ -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;
......
......@@ -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) {
......
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment