widl: Use DECLSPEC_ALIGN in MSVC compatible way for return types too.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49173
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Emilio Cobos Álvarez 2020-05-17 01:02:04 +02:00 committed by Alexandre Julliard
parent 10bfa512df
commit b1084ff910
1 changed files with 11 additions and 10 deletions

View File

@ -4813,20 +4813,21 @@ void write_func_param_struct( FILE *file, const type_t *iface, const type_t *fun
if (is_array( arg->declspec.type ) || is_ptr( arg->declspec.type )) align = pointer_size;
else type_memsize_and_alignment( arg->declspec.type, &align );
if (align >= pointer_size)
fprintf( file, "%s;\n", arg->name );
else
fprintf( file, "DECLSPEC_ALIGN(%u) %s;\n", pointer_size, arg->name );
if (align < pointer_size)
fprintf( file, "DECLSPEC_ALIGN(%u) ", pointer_size );
fprintf( file, "%s;\n", arg->name );
}
if (add_retval && !is_void( retval->declspec.type ))
{
print_file(file, 2, "%s", "");
write_type_decl( file, &retval->declspec, retval->name );
if (is_array( retval->declspec.type ) || is_ptr( retval->declspec.type ) ||
type_memsize( retval->declspec.type ) == pointer_size)
fprintf( file, ";\n" );
else
fprintf( file, " DECLSPEC_ALIGN(%u);\n", pointer_size );
write_type_left( file, &retval->declspec, NAME_DEFAULT, TRUE, TRUE );
if (needs_space_after( retval->declspec.type )) fputc( ' ', file );
if (!is_array( retval->declspec.type ) && !is_ptr( retval->declspec.type ) &&
type_memsize( retval->declspec.type ) != pointer_size)
{
fprintf( file, "DECLSPEC_ALIGN(%u) ", pointer_size );
}
fprintf( file, "%s;\n", retval->name );
}
print_file(file, 1, "} %s;\n", var_decl );
if (needs_packing) print_file( file, 0, "#include <poppack.h>\n" );