widl: Allow specifying a version for a coclass independently of its typelib version.

This commit is contained in:
Alexandre Julliard 2010-12-22 15:51:29 +01:00
parent 3e6d91280d
commit e5f65edfc9
2 changed files with 3 additions and 2 deletions

View File

@ -2108,7 +2108,7 @@ struct allowed_attr allowed_attr[] =
/* ATTR_UUID */ { 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, "uuid" },
/* ATTR_V1ENUM */ { 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, "v1_enum" },
/* ATTR_VARARG */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "vararg" },
/* ATTR_VERSION */ { 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, "version" },
/* ATTR_VERSION */ { 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, "version" },
/* ATTR_VIPROGID */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "vi_progid" },
/* ATTR_WIREMARSHAL */ { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "wire_marshal" },
};

View File

@ -134,7 +134,8 @@ static int write_coclass( const type_t *class, const typelib_t *typelib )
if (typelib)
{
const UUID *typelib_uuid = get_attrp( typelib->attrs, ATTR_UUID );
const unsigned int version = get_attrv( typelib->attrs, ATTR_VERSION );
unsigned int version = get_attrv( class->attrs, ATTR_VERSION );
if (!version) version = get_attrv( typelib->attrs, ATTR_VERSION );
put_str( indent, "TypeLib = s '%s'\n", format_uuid( typelib_uuid ));
put_str( indent, "Version = s '%u.%u'\n", MAJORVERSION(version), MINORVERSION(version) );
}