Rob Shearman : widl: Add typedefs to typelibs which have the public or uuid attributes, not any other attribute.

Alexandre Julliard julliard at winehq.org
Mon Apr 28 08:01:19 CDT 2008


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

Author: Rob Shearman <rob at codeweavers.com>
Date:   Sat Apr 26 09:51:28 2008 +0100

widl: Add typedefs to typelibs which have the public or uuid attributes, not any other attribute.

---

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

diff --git a/tools/widl/parser.y b/tools/widl/parser.y
index 8e0ff86..45fbd82 100644
--- a/tools/widl/parser.y
+++ b/tools/widl/parser.y
@@ -1676,8 +1676,7 @@ static type_t *reg_typedefs(type_t *type, declarator_list_t *decls, attr_list_t
 
   /* We must generate names for tagless enum, struct or union.
      Typedef-ing a tagless enum, struct or union means we want the typedef
-     to be included in a library whether it has other attributes or not,
-     hence the public attribute.  */
+     to be included in a library hence the public attribute.  */
   if ((type->kind == TKIND_ENUM || type->kind == TKIND_RECORD
        || type->kind == TKIND_UNION) && ! type->name && ! parse_only)
   {
@@ -1685,6 +1684,8 @@ static type_t *reg_typedefs(type_t *type, declarator_list_t *decls, attr_list_t
       attrs = append_attr( attrs, make_attr(ATTR_PUBLIC) );
     type->name = gen_name();
   }
+  else if (is_attr(attrs, ATTR_UUID) && !is_attr(attrs, ATTR_PUBLIC))
+    attrs = append_attr( attrs, make_attr(ATTR_PUBLIC) );
 
   LIST_FOR_EACH_ENTRY( decl, decls, const declarator_t, entry )
   {
@@ -2650,7 +2651,7 @@ static statement_t *process_typedefs(declarator_list_t *decls)
 
         if (! parse_only && do_header)
             write_typedef(type);
-        if (in_typelib && type->attrs)
+        if (in_typelib && is_attr(type->attrs, ATTR_PUBLIC))
             add_typelib_entry(type);
 
         type_list = &(*type_list)->next;
diff --git a/tools/widl/typelib.c b/tools/widl/typelib.c
index cd1c69b..7000788 100644
--- a/tools/widl/typelib.c
+++ b/tools/widl/typelib.c
@@ -173,7 +173,7 @@ unsigned short get_type_vt(type_t *t)
     if (vt) return vt;
   }
 
-  if (t->kind == TKIND_ALIAS && t->attrs)
+  if (t->kind == TKIND_ALIAS && is_attr(t->attrs, ATTR_PUBLIC))
     return VT_USERDEFINED;
 
   switch (t->type) {
diff --git a/tools/widl/write_msft.c b/tools/widl/write_msft.c
index f040dbe..35c1f05 100644
--- a/tools/widl/write_msft.c
+++ b/tools/widl/write_msft.c
@@ -962,8 +962,8 @@ static int encode_type(
       {
         int typeinfo_offset;
 
-        /* typedef'd types without attributes aren't included in the typelib */
-        while (type->typelib_idx < 0 && type->kind == TKIND_ALIAS && ! type->attrs)
+        /* typedef'd types without public attribute aren't included in the typelib */
+        while (type->typelib_idx < 0 && type->kind == TKIND_ALIAS && !is_attr(type->attrs, ATTR_PUBLIC))
           type = type->orig;
 
         chat("encode_type: VT_USERDEFINED - type %p name = %s type->type %d idx %d\n", type,




More information about the wine-cvs mailing list