Alexandre Julliard : widl: Store the size of a pointer in a variable instead of hardcoding the value of the host compiler .
Alexandre Julliard
julliard at winehq.org
Fri Dec 26 12:35:24 CST 2008
Module: wine
Branch: master
Commit: 9ca1382eaeb8f7defe203d97f199e22d93ccb54b
URL: http://source.winehq.org/git/wine.git/?a=commit;h=9ca1382eaeb8f7defe203d97f199e22d93ccb54b
Author: Alexandre Julliard <julliard at winehq.org>
Date: Fri Dec 26 17:20:53 2008 +0100
widl: Store the size of a pointer in a variable instead of hardcoding the value of the host compiler.
---
tools/widl/client.c | 2 ++
tools/widl/proxy.c | 6 ++++--
tools/widl/server.c | 2 ++
tools/widl/typegen.c | 3 ++-
tools/widl/widl.c | 2 ++
tools/widl/widl.h | 1 +
6 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/tools/widl/client.c b/tools/widl/client.c
index 5221e26..93bf1fc 100644
--- a/tools/widl/client.c
+++ b/tools/widl/client.c
@@ -510,6 +510,8 @@ void write_client(const statement_list_t *stmts)
if (!client)
return;
+ pointer_size = sizeof(void*);
+
write_formatstringsdecl(client, indent, stmts, need_stub);
expr_eval_routines = write_expr_eval_routines(client, client_token);
if (expr_eval_routines)
diff --git a/tools/widl/proxy.c b/tools/widl/proxy.c
index dc3c1ae..fdc6cd6 100644
--- a/tools/widl/proxy.c
+++ b/tools/widl/proxy.c
@@ -127,8 +127,6 @@ static void init_proxy(const statement_list_t *stmts)
print_proxy( " return (__frame->_StubMsg.dwStubPhase != PROXY_SENDRECEIVE);\n");
print_proxy( "}\n");
print_proxy( "\n");
- write_formatstringsdecl(proxy, indent, stmts, need_proxy);
- write_stubdescproto();
}
static void clear_output_vars( const var_list_t *args )
@@ -757,6 +755,10 @@ void write_proxies(const statement_list_t *stmts)
init_proxy(stmts);
if(!proxy) return;
+ pointer_size = sizeof(void*);
+
+ write_formatstringsdecl(proxy, indent, stmts, need_proxy);
+ write_stubdescproto();
write_proxy_stmts(stmts, &proc_offset);
expr_eval_routines = write_expr_eval_routines(proxy, proxy_token);
diff --git a/tools/widl/server.c b/tools/widl/server.c
index 9b8edb7..0edee90 100644
--- a/tools/widl/server.c
+++ b/tools/widl/server.c
@@ -450,6 +450,8 @@ void write_server(const statement_list_t *stmts)
if (!server)
return;
+ pointer_size = sizeof(void*);
+
write_formatstringsdecl(server, indent, stmts, need_stub);
expr_eval_routines = write_expr_eval_routines(server, server_token);
if (expr_eval_routines)
diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c
index 123715c..a452bdf 100644
--- a/tools/widl/typegen.c
+++ b/tools/widl/typegen.c
@@ -1018,7 +1018,8 @@ size_t type_memsize(const type_t *t, unsigned int *align)
}
else if (is_ptr(t) || is_conformant_array(t))
{
- size = sizeof(void *);
+ assert( pointer_size );
+ size = pointer_size;
if (size > *align) *align = size;
}
else switch (t->type)
diff --git a/tools/widl/widl.c b/tools/widl/widl.c
index 9b14de2..c10f4a1 100644
--- a/tools/widl/widl.c
+++ b/tools/widl/widl.c
@@ -132,6 +132,8 @@ FILE *local_stubs;
FILE *proxy;
FILE *idfile;
+size_t pointer_size = 0;
+
time_t now;
enum {
diff --git a/tools/widl/widl.h b/tools/widl/widl.h
index f08a9ae..07d886a 100644
--- a/tools/widl/widl.h
+++ b/tools/widl/widl.h
@@ -59,6 +59,7 @@ extern char *server_name;
extern char *server_token;
extern const char *prefix_client;
extern const char *prefix_server;
+extern size_t pointer_size;
extern time_t now;
extern int line_number;
More information about the wine-cvs
mailing list