Module: wine Branch: master Commit: 9f1e9ad326de7ab32c02a61f437eab9a2078668f URL: http://source.winehq.org/git/wine.git/?a=commit;h=9f1e9ad326de7ab32c02a61f43...
Author: Alexandre Julliard julliard@winehq.org Date: Fri Jan 26 11:59:58 2007 +0100
widl: Copy the UserMarshal support into the generic code.
---
tools/widl/typegen.c | 20 +++++++++++++++++++- 1 files changed, 19 insertions(+), 1 deletions(-)
diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c index 4b4f4cf..36a6228 100644 --- a/tools/widl/typegen.c +++ b/tools/widl/typegen.c @@ -159,6 +159,20 @@ void write_formatstringsdecl(FILE *f, in print_file(f, indent, "\n"); }
+static int is_user_derived(const var_t *v) +{ + const type_t *type = v->type; + + if (v->attrs && is_attr( v->attrs, ATTR_WIREMARSHAL )) return 1; + + while (type) + { + if (type->attrs && is_attr( type->attrs, ATTR_WIREMARSHAL )) return 1; + type = type->ref; + } + return 0; +} + static inline int is_base_type(unsigned char type) { switch (type) @@ -1835,7 +1849,11 @@ void write_remoting_arguments(FILE *file
rtype = type->type;
- if (is_string_type(var->attrs, var->ptr_level, var->array)) + if (is_user_derived( var )) + { + print_phase_function(file, indent, "UserMarshal", phase, var->name, *type_offset); + } + else if (is_string_type(var->attrs, var->ptr_level, var->array)) { if (var->array && !is_conformant_array(var->array)) print_phase_function(file, indent, "NonConformantString", phase, var->name, *type_offset);