From dccb57dfd9c668eff5e672def93405be8a3303bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Justas=20Lavi=C5=A1ius?= Date: Wed, 27 Jan 2016 17:35:29 +0200 Subject: [PATCH] include: Force stack alignment on x86_64. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Justas LaviĊĦius Signed-off-by: Alexandre Julliard --- include/windef.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/include/windef.h b/include/windef.h index e91472681eb..1e54fcb83ea 100644 --- a/include/windef.h +++ b/include/windef.h @@ -64,7 +64,11 @@ extern "C" { # error You need to define __stdcall for your compiler # endif # elif defined(__x86_64__) && defined (__GNUC__) -# define __stdcall __attribute__((ms_abi)) +# if (__GNUC__ > 5) || ((__GNUC__ == 5) && (__GNUC_MINOR__ >= 3)) +# define __stdcall __attribute__((ms_abi)) __attribute__((__force_align_arg_pointer__)) +# else +# define __stdcall __attribute__((ms_abi)) +# endif # else /* __i386__ */ # define __stdcall # endif /* __i386__ */ @@ -78,7 +82,11 @@ extern "C" { # define __cdecl __attribute__((__cdecl__)) # endif # elif defined(__x86_64__) && defined (__GNUC__) -# define __cdecl __attribute__((ms_abi)) +# if (__GNUC__ > 5) || ((__GNUC__ == 5) && (__GNUC_MINOR__ >= 3)) +# define __cdecl __attribute__((ms_abi)) __attribute__((__force_align_arg_pointer__)) +# else +# define __cdecl __attribute__((ms_abi)) +# endif # elif !defined(_MSC_VER) # define __cdecl # endif