widl: Add typedefs to typelibs which have the public or uuid attributes, not any other attribute.
This commit is contained in:
parent
1d70c7ada4
commit
80be9df3a7
|
@ -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.
|
/* We must generate names for tagless enum, struct or union.
|
||||||
Typedef-ing a tagless enum, struct or union means we want the typedef
|
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,
|
to be included in a library hence the public attribute. */
|
||||||
hence the public attribute. */
|
|
||||||
if ((type->kind == TKIND_ENUM || type->kind == TKIND_RECORD
|
if ((type->kind == TKIND_ENUM || type->kind == TKIND_RECORD
|
||||||
|| type->kind == TKIND_UNION) && ! type->name && ! parse_only)
|
|| 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) );
|
attrs = append_attr( attrs, make_attr(ATTR_PUBLIC) );
|
||||||
type->name = gen_name();
|
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 )
|
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)
|
if (! parse_only && do_header)
|
||||||
write_typedef(type);
|
write_typedef(type);
|
||||||
if (in_typelib && type->attrs)
|
if (in_typelib && is_attr(type->attrs, ATTR_PUBLIC))
|
||||||
add_typelib_entry(type);
|
add_typelib_entry(type);
|
||||||
|
|
||||||
type_list = &(*type_list)->next;
|
type_list = &(*type_list)->next;
|
||||||
|
|
|
@ -173,7 +173,7 @@ unsigned short get_type_vt(type_t *t)
|
||||||
if (vt) return vt;
|
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;
|
return VT_USERDEFINED;
|
||||||
|
|
||||||
switch (t->type) {
|
switch (t->type) {
|
||||||
|
|
|
@ -962,8 +962,8 @@ static int encode_type(
|
||||||
{
|
{
|
||||||
int typeinfo_offset;
|
int typeinfo_offset;
|
||||||
|
|
||||||
/* typedef'd types without attributes aren't included in the typelib */
|
/* typedef'd types without public attribute aren't included in the typelib */
|
||||||
while (type->typelib_idx < 0 && type->kind == TKIND_ALIAS && ! type->attrs)
|
while (type->typelib_idx < 0 && type->kind == TKIND_ALIAS && !is_attr(type->attrs, ATTR_PUBLIC))
|
||||||
type = type->orig;
|
type = type->orig;
|
||||||
|
|
||||||
chat("encode_type: VT_USERDEFINED - type %p name = %s type->type %d idx %d\n", type,
|
chat("encode_type: VT_USERDEFINED - type %p name = %s type->type %d idx %d\n", type,
|
||||||
|
|
Loading…
Reference in New Issue