Module: wine Branch: master Commit: 0e7f6e0ed32ffe5fe09ae429037fc28dcbebe6ea URL: https://source.winehq.org/git/wine.git/?a=commit;h=0e7f6e0ed32ffe5fe09ae4290...
Author: Alexandre Julliard julliard@winehq.org Date: Tue Aug 25 13:51:37 2020 +0200
winebuild: Allow syscalls to use the cdecl convention.
Signed-off-by: Alexandre Julliard julliard@winehq.org
---
tools/winebuild/import.c | 2 +- tools/winebuild/parser.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/winebuild/import.c b/tools/winebuild/import.c index 751335f36f..adb1a3dafe 100644 --- a/tools/winebuild/import.c +++ b/tools/winebuild/import.c @@ -1700,7 +1700,7 @@ void output_syscalls( DLLSPEC *spec ) output( "\tmovl $%s,%%edx\n", asm_name("__wine_syscall") ); } output( "\tcall *%%edx\n" ); - output( "\tret $%u\n", get_args_size( odp )); + output( "\tret $%u\n", odp->type == TYPE_STDCALL ? get_args_size( odp ) : 0 ); break; case CPU_x86_64: /* Chromium depends on syscall thunks having the same form as on diff --git a/tools/winebuild/parser.c b/tools/winebuild/parser.c index 54fffd8a1b..2e6424fe76 100644 --- a/tools/winebuild/parser.c +++ b/tools/winebuild/parser.c @@ -323,9 +323,9 @@ static int parse_spec_arguments( ORDDEF *odp, DLLSPEC *spec, int optional ) } if (odp->flags & FLAG_SYSCALL) { - if (odp->type != TYPE_STDCALL) + if (odp->type != TYPE_STDCALL && odp->type != TYPE_CDECL) { - error( "A syscall function must use the stdcall convention\n" ); + error( "A syscall function must use either the stdcall or the cdecl convention\n" ); return 0; } }