Module: wine Branch: master Commit: 9cda4233df1e970251d0f5595f77b1bc95d6763f URL: https://gitlab.winehq.org/wine/wine/-/commit/9cda4233df1e970251d0f5595f77b1b...
Author: Alexandre Julliard julliard@winehq.org Date: Mon Apr 15 12:04:56 2024 +0200
widl: Pass 16-byte structures by value on ARM64.
---
tools/widl/typegen.c | 13 ++++++++++++- tools/widl/widl.c | 2 +- tools/widl/widl.h | 1 + 3 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c index 917f4b40a21..52874b717fe 100644 --- a/tools/widl/typegen.c +++ b/tools/widl/typegen.c @@ -431,7 +431,18 @@ static unsigned int get_stack_size( const var_t *var, int *by_value ) case TGT_UNION: case TGT_USER_TYPE: stack_size = type_memsize( var->declspec.type ); - by_val = (pointer_size < 8 || stack_size <= pointer_size); /* FIXME: should be platform-specific */ + switch (target.cpu) + { + case CPU_x86_64: + by_val = (stack_size <= pointer_size); + break; + case CPU_ARM64: + by_val = (stack_size <= 2 * pointer_size); + break; + default: + by_val = 1; + break; + } break; default: by_val = 0; diff --git a/tools/widl/widl.c b/tools/widl/widl.c index 6d7dd46c33e..30907eca69b 100644 --- a/tools/widl/widl.c +++ b/tools/widl/widl.c @@ -89,7 +89,7 @@ static const char usage[] = static const char version_string[] = "Wine IDL Compiler version " PACKAGE_VERSION "\n" "Copyright 2002 Ove Kaaven\n";
-static struct target target; +struct target target = { 0 };
int debuglevel = DEBUGLEVEL_NONE; int parser_debug, yy_flex_debug; diff --git a/tools/widl/widl.h b/tools/widl/widl.h index c5ccc140b36..31bb2c83694 100644 --- a/tools/widl/widl.h +++ b/tools/widl/widl.h @@ -71,6 +71,7 @@ extern const char *prefix_client; extern const char *prefix_server; extern unsigned int packing; extern unsigned int pointer_size; +extern struct target target; extern time_t now;
extern int open_typelib( const char *name );