Robert Shearman : widl: Write definitions for MIDL_user_allocate and MIDL_user_free in the header.

Alexandre Julliard julliard at wine.codeweavers.com
Fri Mar 31 13:04:50 CST 2006


Module: wine
Branch: refs/heads/master
Commit: 91dbc5ae286e72197fc4b60a1b2d411237c32ac7
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=91dbc5ae286e72197fc4b60a1b2d411237c32ac7

Author: Robert Shearman <rob at codeweavers.com>
Date:   Fri Mar 31 12:45:29 2006 +0100

widl: Write definitions for MIDL_user_allocate and MIDL_user_free in the header.

Write definitions for MIDL_user_allocate and MIDL_user_free in the
header when writing out RPC interfaces to prevent compile failures in
the generated client/server code.

---

 tools/widl/header.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/tools/widl/header.c b/tools/widl/header.c
index ba241f6..c4f3a26 100644
--- a/tools/widl/header.c
+++ b/tools/widl/header.c
@@ -916,6 +916,14 @@ static void write_rpc_interface(const ty
 {
   unsigned long ver = get_attrv(iface->attrs, ATTR_VERSION);
   const char *var = get_attrp(iface->attrs, ATTR_IMPLICIT_HANDLE);
+  static int allocate_written = 0;
+
+  if (!allocate_written)
+  {
+    allocate_written = 1;
+    fprintf(header, "void * __RPC_USER MIDL_user_allocate(size_t);\n");
+    fprintf(header, "void __RPC_USER MIDL_user_free(void *);\n\n");
+  }
 
   fprintf(header, "/*****************************************************************************\n");
   fprintf(header, " * %s interface (v%d.%d)\n", iface->name, LOWORD(ver), HIWORD(ver));




More information about the wine-cvs mailing list