From f21eab110127a27855db84b5a7d53f2c44984a0b Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Mon, 13 Jul 2009 09:23:06 +0200 Subject: [PATCH] widl: Take into account the alignment of conformant arrays to pad a structure. --- tools/widl/typegen.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c index 3a5e2e58061..d297eb28d59 100644 --- a/tools/widl/typegen.c +++ b/tools/widl/typegen.c @@ -2208,11 +2208,12 @@ static void write_struct_members(FILE *file, const type_t *type, if (fields) LIST_FOR_EACH_ENTRY( field, fields, const var_t, entry ) { type_t *ft = field->type; + unsigned int align = 0; + unsigned int size = type_memsize(ft, &align); + if (salign < align) salign = align; + if (!is_conformant_array(ft) || type_array_is_decl_as_ptr(ft)) { - unsigned int align = 0; - unsigned int size = type_memsize(ft, &align); - if (salign < align) salign = align; if ((align - 1) & offset) { unsigned char fc = 0;