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

Alexandre Julliard julliard at winehq.org
Wed Dec 22 10:57:43 CST 2010


Module: wine
Branch: master
Commit: e5f65edfc9f57907591fd213f3f5e68222d51130
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=e5f65edfc9f57907591fd213f3f5e68222d51130

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Wed Dec 22 15:51:29 2010 +0100

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

---

 tools/widl/parser.y   |    2 +-
 tools/widl/register.c |    3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/tools/widl/parser.y b/tools/widl/parser.y
index c924a66..30ae5f4 100644
--- a/tools/widl/parser.y
+++ b/tools/widl/parser.y
@@ -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" },
 };
diff --git a/tools/widl/register.c b/tools/widl/register.c
index 9913f8c..d58fc0a 100644
--- a/tools/widl/register.c
+++ b/tools/widl/register.c
@@ -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) );
     }




More information about the wine-cvs mailing list