Alexandre Julliard : widl: Use delegation when inheriting from a local interface.

Alexandre Julliard julliard at winehq.org
Tue Jun 14 11:57:45 CDT 2011


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Jun 13 22:16:05 2011 +0200

widl: Use delegation when inheriting from a local interface.

---

 tools/widl/proxy.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/tools/widl/proxy.c b/tools/widl/proxy.c
index 5f17631..e5b2f9f 100644
--- a/tools/widl/proxy.c
+++ b/tools/widl/proxy.c
@@ -142,9 +142,8 @@ int cant_be_null(const var_t *v)
 
 static int need_delegation(const type_t *iface)
 {
-    return type_iface_get_inherit(iface) &&
-           type_iface_get_inherit(type_iface_get_inherit(iface)) &&
-           type_iface_get_inherit(iface)->ignore;
+    const type_t *parent = type_iface_get_inherit( iface );
+    return parent && type_iface_get_inherit(parent) && (parent->ignore || is_local( parent->attrs ));
 }
 
 static int get_delegation_indirect(const type_t *iface, const type_t ** delegate_to)
@@ -944,7 +943,7 @@ static void write_proxy_routines(const statement_list_t *stmts)
   int expr_eval_routines;
   unsigned int proc_offset = 0;
   char *file_id = proxy_token;
-  int i, count, have_baseiid;
+  int i, count, have_baseiid = 0;
   type_t **interfaces;
   const type_t * delegate_to;
 
@@ -1021,7 +1020,10 @@ static void write_proxy_routines(const statement_list_t *stmts)
   fprintf(proxy, "};\n");
   fprintf(proxy, "\n");
 
-  if ((have_baseiid = does_any_iface(stmts, need_delegation_indirect)))
+  for (i = 0; i < count; i++)
+      if ((have_baseiid = get_delegation_indirect( interfaces[i], NULL ))) break;
+
+  if (have_baseiid)
   {
       fprintf(proxy, "static const IID * _%s_BaseIIDList[] =\n", file_id);
       fprintf(proxy, "{\n");




More information about the wine-cvs mailing list