Piotr Caban : widl: Make it possible to set typelib resource id with id attribute.

Alexandre Julliard julliard at winehq.org
Fri Jan 18 12:07:37 CST 2013


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

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Fri Jan 18 12:40:20 2013 +0100

widl: Make it possible to set typelib resource id with id attribute.

---

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

diff --git a/tools/widl/parser.y b/tools/widl/parser.y
index 9c2281f..d8435b9 100644
--- a/tools/widl/parser.y
+++ b/tools/widl/parser.y
@@ -2057,7 +2057,7 @@ struct allowed_attr allowed_attr[] =
     /* ATTR_HELPSTRINGCONTEXT */   { 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, "helpstringcontext" },
     /* ATTR_HELPSTRINGDLL */       { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, "helpstringdll" },
     /* ATTR_HIDDEN */              { 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, "hidden" },
-    /* ATTR_ID */                  { 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, "id" },
+    /* ATTR_ID */                  { 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, "id" },
     /* ATTR_IDEMPOTENT */          { 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "idempotent" },
     /* ATTR_IGNORE */              { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, "ignore" },
     /* ATTR_IIDIS */               { 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, "iid_is" },
diff --git a/tools/widl/write_msft.c b/tools/widl/write_msft.c
index 918923b..53e1feb 100644
--- a/tools/widl/write_msft.c
+++ b/tools/widl/write_msft.c
@@ -2547,7 +2547,12 @@ static void save_all_changes(msft_typelib_t *typelib)
 
     if (strendswith( typelib_name, ".res" ))  /* create a binary resource file */
     {
-        add_output_to_resources( "TYPELIB", "#1" );
+        char typelib_id[13] = "#1";
+
+        expr_t *expr = get_attrp( typelib->typelib->attrs, ATTR_ID );
+        if (expr)
+            sprintf( typelib_id, "#%d", expr->cval );
+        add_output_to_resources( "TYPELIB", typelib_id );
         output_typelib_regscript( typelib->typelib );
         flush_output_resources( typelib_name );
     }




More information about the wine-cvs mailing list