From dd1a83c20a84f581bc36768669ccb4a7417fb418 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Sun, 25 Aug 2019 18:49:23 +0200 Subject: [PATCH] winebuild: Don't include aliases in importlib .def files. Signed-off-by: Jacek Caban Signed-off-by: Alexandre Julliard --- tools/winebuild/build.h | 2 +- tools/winebuild/import.c | 2 +- tools/winebuild/main.c | 2 +- tools/winebuild/spec32.c | 7 ++++--- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/tools/winebuild/build.h b/tools/winebuild/build.h index 43a0dd20e82..bde322cef30 100644 --- a/tools/winebuild/build.h +++ b/tools/winebuild/build.h @@ -310,7 +310,7 @@ extern void output_resources( DLLSPEC *spec ); extern void output_bin_resources( DLLSPEC *spec, unsigned int start_rva ); extern void output_spec32_file( DLLSPEC *spec ); extern void output_fake_module( DLLSPEC *spec ); -extern void output_def_file( DLLSPEC *spec, int include_stubs ); +extern void output_def_file( DLLSPEC *spec, int import_only ); extern void load_res16_file( const char *name, DLLSPEC *spec ); extern void output_res16_data( DLLSPEC *spec ); extern void output_bin_res16_data( DLLSPEC *spec ); diff --git a/tools/winebuild/import.c b/tools/winebuild/import.c index 7d3c7252cc4..e2688a058aa 100644 --- a/tools/winebuild/import.c +++ b/tools/winebuild/import.c @@ -1452,7 +1452,7 @@ static void build_windows_import_lib( DLLSPEC *spec ) const char *as_flags, *m_flag; def_file = open_temp_output_file( ".def" ); - output_def_file( spec, 0 ); + output_def_file( spec, 1 ); fclose( output_file ); args = find_tool( "dlltool", NULL ); diff --git a/tools/winebuild/main.c b/tools/winebuild/main.c index 0a5becd870d..7d54395860f 100644 --- a/tools/winebuild/main.c +++ b/tools/winebuild/main.c @@ -664,7 +664,7 @@ int main(int argc, char **argv) if (!spec_file_name) fatal_error( "missing .spec file\n" ); if (!parse_input_file( spec )) break; open_output_file(); - output_def_file( spec, 1 ); + output_def_file( spec, 0 ); close_output_file(); break; case MODE_IMPLIB: diff --git a/tools/winebuild/spec32.c b/tools/winebuild/spec32.c index 855e6d8739f..f2567e8a922 100644 --- a/tools/winebuild/spec32.c +++ b/tools/winebuild/spec32.c @@ -983,7 +983,7 @@ void output_fake_module( DLLSPEC *spec ) * * Build a Win32 def file from a spec file. */ -void output_def_file( DLLSPEC *spec, int include_stubs ) +void output_def_file( DLLSPEC *spec, int import_only ) { DLLSPEC *spec32 = NULL; const char *name; @@ -1017,7 +1017,7 @@ void output_def_file( DLLSPEC *spec, int include_stubs ) else continue; if (!is_private) total++; - if (!include_stubs && odp->type == TYPE_STUB) continue; + if (import_only && odp->type == TYPE_STUB) continue; if ((odp->flags & FLAG_FASTCALL) && target_platform == PLATFORM_WINDOWS) name = strmake( "@%s", name ); @@ -1032,13 +1032,14 @@ void output_def_file( DLLSPEC *spec, int include_stubs ) case TYPE_VARARGS: case TYPE_CDECL: /* try to reduce output */ - if(strcmp(name, odp->link_name) || (odp->flags & FLAG_FORWARD)) + if(!import_only && (strcmp(name, odp->link_name) || (odp->flags & FLAG_FORWARD))) output( "=%s", odp->link_name ); break; case TYPE_STDCALL: { int at_param = get_args_size( odp ); if (!kill_at && target_cpu == CPU_x86) output( "@%d", at_param ); + if (import_only) break; if (odp->flags & FLAG_FORWARD) output( "=%s", odp->link_name ); else if (strcmp(name, odp->link_name)) /* try to reduce output */