widl [6/7]: Output NULL for inherited methods in the vtbl.

Dan Hipschman dsh at linux.ucla.edu
Wed Nov 21 19:21:28 CST 2007


This fixes the widl output for vtbls with inheritance.  Inherited methods
should be listed as NULL and handled by STUB_FORWARDING_FUNCTION.

---
 tools/widl/proxy.c |   30 +++++++++++++++++-------------
 1 files changed, 17 insertions(+), 13 deletions(-)

diff --git a/tools/widl/proxy.c b/tools/widl/proxy.c
index 45f312a..7ad664b 100644
--- a/tools/widl/proxy.c
+++ b/tools/widl/proxy.c
@@ -437,41 +437,45 @@ static void gen_stub(type_t *iface, const func_t *cur, const char *cas,
   print_proxy("\n");
 }
 
-static int write_proxy_methods(type_t *iface)
+static int write_proxy_methods(type_t *iface, int skip)
 {
   const func_t *cur;
   int i = 0;
 
-  if (iface->ref) i = write_proxy_methods(iface->ref);
+  if (iface->ref) i = write_proxy_methods(iface->ref, iface->ref->ref != NULL);
   if (iface->funcs) LIST_FOR_EACH_ENTRY( cur, iface->funcs, const func_t, entry ) {
     var_t *def = cur->def;
     if (!is_callas(def->attrs)) {
       if (i) fprintf(proxy, ",\n");
-      print_proxy( "%s_", iface->name);
+      print_proxy( "%s%s_", skip ? "0\t/* " : "", iface->name);
       write_name(proxy, def);
-      fprintf(proxy, "_Proxy");
+      fprintf(proxy, "_Proxy%s", skip ? " */" : "");
       i++;
     }
   }
   return i;
 }
 
-static int write_stub_methods(type_t *iface)
+static int write_stub_methods(type_t *iface, int skip)
 {
   const func_t *cur;
   int i = 0;
 
-  if (iface->ref) i = write_stub_methods(iface->ref);
+  if (iface->ref) i = write_stub_methods(iface->ref, TRUE);
   else return i; /* skip IUnknown */
 
   if (iface->funcs) LIST_FOR_EACH_ENTRY( cur, iface->funcs, const func_t, entry ) {
     var_t *def = cur->def;
     if (!is_local(def->attrs)) {
-      if (i) fprintf(proxy,",\n");
-      print_proxy( "%s_", iface->name);
-      write_name(proxy, def);
-      fprintf(proxy, "_Stub");
-      i++;
+      if (skip)
+        print_proxy("STUB_FORWARDING_FUNCTION,\n");
+      else {
+        if (i) fprintf(proxy,",\n");
+        print_proxy( "%s_", iface->name);
+        write_name(proxy, def);
+        fprintf(proxy, "_Stub");
+        i++;
+      }
     }
   }
   return i;
@@ -525,7 +529,7 @@ static void write_proxy(type_t *iface, unsigned int *proc_offset)
   print_proxy( "},\n");
   print_proxy( "{\n");
   indent++;
-  write_proxy_methods(iface);
+  write_proxy_methods(iface, FALSE);
   fprintf(proxy, "\n");
   indent--;
   print_proxy( "}\n");
@@ -537,7 +541,7 @@ static void write_proxy(type_t *iface, unsigned int *proc_offset)
   print_proxy( "static const PRPC_STUB_FUNCTION %s_table[] =\n", iface->name);
   print_proxy( "{\n");
   indent++;
-  stubs = write_stub_methods(iface);
+  stubs = write_stub_methods(iface, FALSE);
   fprintf(proxy, "\n");
   indent--;
   fprintf(proxy, "};\n");



More information about the wine-patches mailing list