From 5e41cc9ce86e5cbdf34544931b6fa82e89d7bebc Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Wed, 19 Nov 2008 20:33:58 +0000 Subject: [PATCH] Sync to wine-1.1.1 (Patch 1 of 10): - Alexandre Julliard Tue, 1 Jul 2008 widl: Add some support for unencapsulated unions that need a conformance descriptor. svn path=/trunk/; revision=37466 --- reactos/tools/widl/typegen.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/reactos/tools/widl/typegen.c b/reactos/tools/widl/typegen.c index 795d70537ad..4581929c66e 100644 --- a/reactos/tools/widl/typegen.c +++ b/reactos/tools/widl/typegen.c @@ -2032,6 +2032,34 @@ static size_t write_union_tfs(FILE *file, type_t *type, unsigned int *tfsoff) error("union switch type must be an integer, char, or enum\n"); } } + else if (is_attr(type->attrs, ATTR_SWITCHTYPE)) + { + static const expr_t dummy_expr; /* FIXME */ + const type_t *st = get_attrp(type->attrs, ATTR_SWITCHTYPE); + + switch (st->type) + { + case RPC_FC_CHAR: + case RPC_FC_SMALL: + case RPC_FC_USMALL: + case RPC_FC_SHORT: + case RPC_FC_USHORT: + case RPC_FC_LONG: + case RPC_FC_ULONG: + case RPC_FC_ENUM16: + case RPC_FC_ENUM32: + print_file(file, 2, "0x%x,\t/* %s */\n", type->type, string_of_type(type->type)); + print_file(file, 2, "0x%x,\t/* Switch type= %s */\n", + st->type, string_of_type(st->type)); + *tfsoff += 2; + break; + default: + error("union switch type must be an integer, char, or enum\n"); + } + + *tfsoff += write_conf_or_var_desc(file, NULL, *tfsoff, st, &dummy_expr ); + } + print_file(file, 2, "NdrFcShort(0x%x),\t/* %d */\n", size, size); print_file(file, 2, "NdrFcShort(0x%x),\t/* %d */\n", nbranch, nbranch); *tfsoff += 4;