From: Rémi Bernon rbernon@codeweavers.com
And rename it to get_abi_name. --- tools/winebuild/build.h | 2 +- tools/winebuild/import.c | 4 ++-- tools/winebuild/spec16.c | 2 +- tools/winebuild/spec32.c | 10 +++++----- tools/winebuild/utils.c | 24 ++++++++++++------------ 5 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/tools/winebuild/build.h b/tools/winebuild/build.h index 9918c2341f4..79a22315b0d 100644 --- a/tools/winebuild/build.h +++ b/tools/winebuild/build.h @@ -273,7 +273,7 @@ extern DLLSPEC *alloc_dll_spec(void); extern void free_dll_spec( DLLSPEC *spec ); extern char *make_c_identifier( const char *str ); extern const char *get_stub_name( const ORDDEF *odp, const DLLSPEC *spec ); -extern const char *get_link_name( const ORDDEF *odp ); +extern const char *get_abi_name( const ORDDEF *odp, const char *name ); extern int sort_func_list( ORDDEF **list, int count, int (*compare)(const void *, const void *) ); extern unsigned int get_alignment(unsigned int align); extern unsigned int get_page_size(void); diff --git a/tools/winebuild/import.c b/tools/winebuild/import.c index b1c14db9cab..3f3775dc3bd 100644 --- a/tools/winebuild/import.c +++ b/tools/winebuild/import.c @@ -627,7 +627,7 @@ static char *create_undef_symbols_file( DLLSPEC *spec ) if (odp->type == TYPE_STUB || odp->type == TYPE_ABS || odp->type == TYPE_VARIABLE) continue; if (odp->flags & FLAG_FORWARD) continue; if (odp->flags & FLAG_SYSCALL) continue; - output( "\t%s %s\n", get_asm_ptr_keyword(), asm_name( get_link_name( odp ))); + output( "\t%s %s\n", get_asm_ptr_keyword(), asm_name( get_abi_name( odp, odp->link_name ))); } for (j = 0; j < extra_ld_symbols.count; j++) output( "\t%s %s\n", get_asm_ptr_keyword(), asm_name(extra_ld_symbols.str[j]) ); @@ -1393,7 +1393,7 @@ void output_syscalls( DLLSPEC *spec ) for (i = 0; i < count; i++) { ORDDEF *odp = syscalls[i]; - const char *name = get_link_name(odp); + const char *name = get_abi_name(odp, odp->link_name); unsigned int id = (spec->syscall_table << 12) + i;
output( "\t.align %d\n", get_alignment(16) ); diff --git a/tools/winebuild/spec16.c b/tools/winebuild/spec16.c index 8d4f96ea323..ea5fb44986c 100644 --- a/tools/winebuild/spec16.c +++ b/tools/winebuild/spec16.c @@ -738,7 +738,7 @@ static void output_module16( DLLSPEC *spec ) output( ".L__wine_%s_%u:\n", spec->c_name, i ); output( "\tpushw %%bp\n" ); output( "\tpushl $%s\n", - asm_name( odp->type == TYPE_STUB ? get_stub_name( odp, spec ) : get_link_name( odp ))); + asm_name( odp->type == TYPE_STUB ? get_stub_name( odp, spec ) : get_abi_name( odp, odp->link_name ))); output( "\tcallw .L__wine_spec_callfrom16_%s\n", get_callfrom16_name( odp ) ); } output( ".L__wine_spec_code_segment_end:\n" ); diff --git a/tools/winebuild/spec32.c b/tools/winebuild/spec32.c index c09e58084cc..c445a2440d2 100644 --- a/tools/winebuild/spec32.c +++ b/tools/winebuild/spec32.c @@ -470,7 +470,7 @@ void output_exports( DLLSPEC *spec ) } else { - output( "\t%s %s\n", func_ptr, asm_name( get_link_name( odp ))); + output( "\t%s %s\n", func_ptr, asm_name( get_abi_name( odp, odp->link_name ))); } break; case TYPE_STUB: @@ -592,14 +592,14 @@ void output_exports( DLLSPEC *spec ) if (UsePIC) { output( "\tcall %s\n", asm_name("__wine_spec_get_pc_thunk_eax") ); - output( "1:\tjmp *__imp_%s-1b(%%eax)\n", asm_name( get_link_name( odp ))); + output( "1:\tjmp *__imp_%s-1b(%%eax)\n", asm_name( get_abi_name( odp, odp->link_name ))); needs_get_pc_thunk = 1; } - else output( "\tjmp *__imp_%s\n", asm_name( get_link_name( odp ))); + else output( "\tjmp *__imp_%s\n", asm_name( get_abi_name( odp, odp->link_name ))); break; case CPU_x86_64: output( "\t.byte 0x48,0x8d,0xa4,0x24,0x00,0x00,0x00,0x00\n" ); /* hotpatch prolog */ - output( "\tjmp *__imp_%s(%%rip)\n", asm_name( get_link_name( odp ))); + output( "\tjmp *__imp_%s(%%rip)\n", asm_name( get_abi_name( odp, odp->link_name ))); break; default: assert(0); @@ -1325,7 +1325,7 @@ void output_def_file( DLLSPEC *spec, int import_only ) if (odp->flags & FLAG_FORWARD) output( "=%s", odp->link_name ); else if (strcmp(name, odp->link_name)) /* try to reduce output */ - output( "=%s", get_link_name( odp )); + output( "=%s", get_abi_name( odp, odp->link_name )); break; } case TYPE_STUB: diff --git a/tools/winebuild/utils.c b/tools/winebuild/utils.c index 4f1bdf7cd2d..eb75aaed50b 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 ) +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 );