widl: Allow specifying a class version outside of a typelib too.
This commit is contained in:
parent
fc3114ca80
commit
90c7acf845
|
@ -121,6 +121,7 @@ static int write_coclass( const type_t *class, const typelib_t *typelib )
|
||||||
const char *progid = get_attrp( class->attrs, ATTR_PROGID );
|
const char *progid = get_attrp( class->attrs, ATTR_PROGID );
|
||||||
const char *vi_progid = get_attrp( class->attrs, ATTR_VIPROGID );
|
const char *vi_progid = get_attrp( class->attrs, ATTR_VIPROGID );
|
||||||
const char *threading = get_coclass_threading( class );
|
const char *threading = get_coclass_threading( class );
|
||||||
|
unsigned int version = get_attrv( class->attrs, ATTR_VERSION );
|
||||||
|
|
||||||
if (!uuid) return 0;
|
if (!uuid) return 0;
|
||||||
if (typelib && !threading) return 0;
|
if (typelib && !threading) return 0;
|
||||||
|
@ -134,11 +135,10 @@ static int write_coclass( const type_t *class, const typelib_t *typelib )
|
||||||
if (typelib)
|
if (typelib)
|
||||||
{
|
{
|
||||||
const UUID *typelib_uuid = get_attrp( typelib->attrs, ATTR_UUID );
|
const UUID *typelib_uuid = get_attrp( typelib->attrs, ATTR_UUID );
|
||||||
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, "TypeLib = s '%s'\n", format_uuid( typelib_uuid ));
|
||||||
put_str( indent, "Version = s '%u.%u'\n", MAJORVERSION(version), MINORVERSION(version) );
|
if (!version) version = get_attrv( typelib->attrs, ATTR_VERSION );
|
||||||
}
|
}
|
||||||
|
if (version) put_str( indent, "Version = s '%u.%u'\n", MAJORVERSION(version), MINORVERSION(version) );
|
||||||
if (vi_progid) put_str( indent, "VersionIndependentProgId = s '%s'\n", vi_progid );
|
if (vi_progid) put_str( indent, "VersionIndependentProgId = s '%s'\n", vi_progid );
|
||||||
put_str( --indent, "}\n" );
|
put_str( --indent, "}\n" );
|
||||||
return 1;
|
return 1;
|
||||||
|
|
Loading…
Reference in New Issue