widl: Generate correct alignment for encapsulated union tags.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2018-04-10 20:30:26 -05:00 committed by Alexandre Julliard
parent 71b3ba57f7
commit 6c942496a9
1 changed files with 9 additions and 1 deletions

View File

@ -3276,6 +3276,7 @@ static unsigned int write_union_tfs(FILE *file, const attr_list_t *attrs,
{
const var_t *sv = type_union_get_switch_value(type);
const type_t *st = sv->type;
unsigned int align = 0;
unsigned char fc;
if (type_get_type(st) == TYPE_BASIC)
@ -3303,9 +3304,16 @@ static unsigned int write_union_tfs(FILE *file, const attr_list_t *attrs,
else
error("union switch type must be an integer, char, or enum\n");
type_memsize_and_alignment(st, &align);
if (fields) LIST_FOR_EACH_ENTRY(f, fields, var_t, entry)
{
if (f->type)
type_memsize_and_alignment(f->type, &align);
}
print_file(file, 2, "0x%x,\t/* FC_ENCAPSULATED_UNION */\n", RPC_FC_ENCAPSULATED_UNION);
print_file(file, 2, "0x%x,\t/* Switch type= %s */\n",
0x40 | fc, string_of_type(fc));
(align << 4) | fc, string_of_type(fc));
*tfsoff += 2;
}
else if (is_attr(type->attrs, ATTR_SWITCHTYPE))