Alexandre Julliard : include: Force aligning stack pointer also for Mingw builds.

Alexandre Julliard julliard at winehq.org
Thu Nov 26 16:30:59 CST 2020


Module: wine
Branch: master
Commit: 5a0c9270b1225da86782bffd9eb798a39723d70f
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=5a0c9270b1225da86782bffd9eb798a39723d70f

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Thu Nov 26 16:01:49 2020 +0100

include: Force aligning stack pointer also for Mingw builds.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50189
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 include/msvcrt/corecrt.h | 22 +++++++---------------
 include/windef.h         | 22 +++++++---------------
 2 files changed, 14 insertions(+), 30 deletions(-)

diff --git a/include/msvcrt/corecrt.h b/include/msvcrt/corecrt.h
index 587dcce2a54..eee028c2028 100644
--- a/include/msvcrt/corecrt.h
+++ b/include/msvcrt/corecrt.h
@@ -61,7 +61,8 @@
 #define __has_attribute(x) 0
 #endif
 
-#if !defined(_MSC_VER) && !defined(__stdcall)
+#ifndef _MSC_VER
+# undef __stdcall
 # ifdef __i386__
 #  ifdef __GNUC__
 #   if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2)) || defined(__APPLE__)
@@ -87,27 +88,18 @@
 # endif  /* __i386__ */
 #endif /* __stdcall */
 
-#if !defined(_MSC_VER) && !defined(__cdecl)
+#ifndef _MSC_VER
+# undef __cdecl
 # if defined(__i386__) && defined(__GNUC__)
-#   if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2)) || defined(__APPLE__)
+#  if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2)) || defined(__APPLE__)
 #   define __cdecl __attribute__((__cdecl__)) __attribute__((__force_align_arg_pointer__))
 #  else
 #   define __cdecl __attribute__((__cdecl__))
 #  endif
-# elif defined(__x86_64__) && defined (__GNUC__)
-#  if __has_attribute(__force_align_arg_pointer__)
-#   define __cdecl __attribute__((ms_abi)) __attribute__((__force_align_arg_pointer__))
-#  else
-#   define __cdecl __attribute__((ms_abi))
-#  endif
-# elif defined(__arm__) && defined (__GNUC__) && !defined(__SOFTFP__)
-#   define __cdecl __attribute__((pcs("aapcs-vfp")))
-# elif defined(__aarch64__) && defined (__GNUC__)
-#  define __cdecl __attribute__((ms_abi))
 # else
-#  define __cdecl
+#  define __cdecl __stdcall
 # endif
-#endif /* __cdecl */
+#endif
 
 #ifndef __ms_va_list
 # if (defined(__x86_64__) || defined(__aarch64__)) && defined (__GNUC__)
diff --git a/include/windef.h b/include/windef.h
index db5c60641d4..b8e5ed692b1 100644
--- a/include/windef.h
+++ b/include/windef.h
@@ -54,7 +54,8 @@ extern "C" {
 # endif
 #endif
 
-#if !defined(_MSC_VER) && !defined(__stdcall)
+#ifndef _MSC_VER
+# undef __stdcall
 # ifdef __i386__
 #  ifdef __GNUC__
 #   if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2)) || defined(__APPLE__)
@@ -80,27 +81,18 @@ extern "C" {
 # endif  /* __i386__ */
 #endif /* __stdcall */
 
-#if !defined(_MSC_VER) && !defined(__cdecl)
+#ifndef _MSC_VER
+# undef __cdecl
 # if defined(__i386__) && defined(__GNUC__)
-#   if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2)) || defined(__APPLE__)
+#  if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2)) || defined(__APPLE__)
 #   define __cdecl __attribute__((__cdecl__)) __attribute__((__force_align_arg_pointer__))
 #  else
 #   define __cdecl __attribute__((__cdecl__))
 #  endif
-# elif defined(__x86_64__) && defined (__GNUC__)
-#  if __has_attribute(__force_align_arg_pointer__)
-#   define __cdecl __attribute__((ms_abi)) __attribute__((__force_align_arg_pointer__))
-#  else
-#   define __cdecl __attribute__((ms_abi))
-#  endif
-# elif defined(__arm__) && defined (__GNUC__) && !defined(__SOFTFP__)
-#   define __cdecl __attribute__((pcs("aapcs-vfp")))
-# elif defined(__aarch64__) && defined (__GNUC__)
-#  define __cdecl __attribute__((ms_abi))
 # else
-#  define __cdecl
+#  define __cdecl __stdcall
 # endif
-#endif /* __cdecl */
+#endif
 
 #if !defined(_MSC_VER) && !defined(__fastcall)
 # define __fastcall __stdcall




More information about the wine-cvs mailing list