Author: ekohl Date: Wed Nov 19 14:33:58 2008 New Revision: 37466
URL: http://svn.reactos.org/svn/reactos?rev=37466&view=rev Log: Sync to wine-1.1.1 (Patch 1 of 10): - Alexandre Julliard julliard@winehq.org Tue, 1 Jul 2008 widl: Add some support for unencapsulated unions that need a conformance descriptor.
Modified: trunk/reactos/tools/widl/typegen.c
Modified: trunk/reactos/tools/widl/typegen.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/widl/typegen.c?rev=37... ============================================================================== --- trunk/reactos/tools/widl/typegen.c [iso-8859-1] (original) +++ trunk/reactos/tools/widl/typegen.c [iso-8859-1] Wed Nov 19 14:33:58 2008 @@ -2032,6 +2032,34 @@ 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;