Module: wine Branch: master Commit: 6932138f179eb644747d58e9a8d2edde1934058d URL: https://gitlab.winehq.org/wine/wine/-/commit/6932138f179eb644747d58e9a8d2edd...
Author: Rémi Bernon rbernon@codeweavers.com Date: Sun Oct 2 23:32:57 2022 +0200
winebuild: Split get_link_name into a separate get_abi_name helper.
---
tools/winebuild/utils.c | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-)
diff --git a/tools/winebuild/utils.c b/tools/winebuild/utils.c index 4f1bdf7cd2d..bac249673b6 100644 --- a/tools/winebuild/utils.c +++ b/tools/winebuild/utils.c @@ -728,28 +728,28 @@ const char *get_stub_name( const ORDDEF *odp, const DLLSPEC *spec ) }
/* return the stdcall-decorated name for an entry point */ -const char *get_link_name( const ORDDEF *odp ) +static const char *get_abi_name( const ORDDEF *odp, const char *name ) { static char *buffer; char *ret;
- if (target.cpu != CPU_i386) return odp->link_name; + if (target.cpu != CPU_i386) return name;
switch (odp->type) { case TYPE_STDCALL: if (is_pe()) { - if (odp->flags & FLAG_THISCALL) return odp->link_name; - if (odp->flags & FLAG_FASTCALL) ret = strmake( "@%s@%u", odp->link_name, get_args_size( odp )); - else if (!kill_at) ret = strmake( "%s@%u", odp->link_name, get_args_size( odp )); - else return odp->link_name; + if (odp->flags & FLAG_THISCALL) return name; + if (odp->flags & FLAG_FASTCALL) ret = strmake( "@%s@%u", name, get_args_size( odp )); + else if (!kill_at) ret = strmake( "%s@%u", name, get_args_size( odp )); + else return name; } else { - if (odp->flags & FLAG_THISCALL) ret = strmake( "__thiscall_%s", odp->link_name ); - else if (odp->flags & FLAG_FASTCALL) ret = strmake( "__fastcall_%s", odp->link_name ); - else return odp->link_name; + if (odp->flags & FLAG_THISCALL) ret = strmake( "__thiscall_%s", name ); + else if (odp->flags & FLAG_FASTCALL) ret = strmake( "__fastcall_%s", name ); + else return name; } break;
@@ -758,13 +758,13 @@ const char *get_link_name( const ORDDEF *odp ) { int args = get_args_size( odp ); if (odp->flags & FLAG_REGISTER) args += get_ptr_size(); /* context argument */ - ret = strmake( "%s@%u", odp->link_name, args ); + ret = strmake( "%s@%u", name, args ); } - else return odp->link_name; + else return name; break;
default: - return odp->link_name; + return name; }
free( buffer ); @@ -772,6 +772,11 @@ const char *get_link_name( const ORDDEF *odp ) return ret; }
+const char *get_link_name( const ORDDEF *odp ) +{ + return get_abi_name( odp, odp->link_name ); +} + /******************************************************************* * sort_func_list *