From 90c7acf845c260aace38b2abee237024908b7bf9 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Thu, 23 Dec 2010 12:50:35 +0100 Subject: [PATCH] widl: Allow specifying a class version outside of a typelib too. --- tools/widl/register.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/widl/register.c b/tools/widl/register.c index d58fc0adf4..6b9980fc04 100644 --- a/tools/widl/register.c +++ b/tools/widl/register.c @@ -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 *vi_progid = get_attrp( class->attrs, ATTR_VIPROGID ); const char *threading = get_coclass_threading( class ); + unsigned int version = get_attrv( class->attrs, ATTR_VERSION ); if (!uuid) 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) { 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, "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 ); put_str( --indent, "}\n" ); return 1; -- 2.33.8