Skip to content

Commit 87fbf33

Browse files
julliardYuxuan Shui
authored and
Yuxuan Shui
committed
include: Don't align the stack for PE builds.
(upstream commit 6217369) CW-Bug-Id: #22660
1 parent 1f10727 commit 87fbf33

File tree

2 files changed

+12
-20
lines changed

2 files changed

+12
-20
lines changed

include/msvcrt/corecrt.h

+3-6
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
#define __has_attribute(x) 0
8383
#endif
8484

85-
#ifndef _MSC_VER
85+
#if !defined(_MSC_VER) && !defined(__MINGW32__)
8686
# undef __stdcall
8787
# ifdef __i386__
8888
# ifdef __GNUC__
@@ -100,16 +100,13 @@
100100
# else
101101
# define __stdcall __attribute__((ms_abi))
102102
# endif
103-
# elif defined(__arm__) && defined (__GNUC__) && !defined(__SOFTFP__) && !defined(__MINGW32__) && !defined(__CYGWIN__)
103+
# elif defined(__arm__) && defined (__GNUC__) && !defined(__SOFTFP__) && !defined(__CYGWIN__)
104104
# define __stdcall __attribute__((pcs("aapcs-vfp")))
105105
# elif defined(__aarch64__) && defined (__GNUC__) && __has_attribute(ms_abi)
106106
# define __stdcall __attribute__((ms_abi))
107107
# else /* __i386__ */
108108
# define __stdcall
109109
# endif /* __i386__ */
110-
#endif /* __stdcall */
111-
112-
#ifndef _MSC_VER
113110
# undef __cdecl
114111
# if defined(__i386__) && defined(__GNUC__)
115112
# if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2)) || defined(__APPLE__)
@@ -120,7 +117,7 @@
120117
# else
121118
# define __cdecl __stdcall
122119
# endif
123-
#endif
120+
#endif /* _MSC_VER || __MINGW32__ */
124121

125122
#if (defined(__x86_64__) || (defined(__aarch64__) && __has_attribute(ms_abi))) && defined (__GNUC__)
126123
# include <stdarg.h>

include/windef.h

+9-14
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ extern "C" {
5454
# endif
5555
#endif
5656

57-
#ifndef _MSC_VER
57+
#if !defined(_MSC_VER) && !defined(__MINGW32__)
5858
# undef __stdcall
5959
# ifdef __i386__
6060
# ifdef __GNUC__
@@ -72,16 +72,13 @@ extern "C" {
7272
# else
7373
# define __stdcall __attribute__((ms_abi))
7474
# endif
75-
# elif defined(__arm__) && defined (__GNUC__) && !defined(__SOFTFP__) && !defined(__MINGW32__) && !defined(__CYGWIN__)
75+
# elif defined(__arm__) && defined (__GNUC__) && !defined(__SOFTFP__) && !defined(__CYGWIN__)
7676
# define __stdcall __attribute__((pcs("aapcs-vfp")))
7777
# elif defined(__aarch64__) && defined (__GNUC__) && __has_attribute(ms_abi)
7878
# define __stdcall __attribute__((ms_abi))
7979
# else /* __i386__ */
8080
# define __stdcall
8181
# endif /* __i386__ */
82-
#endif /* __stdcall */
83-
84-
#ifndef _MSC_VER
8582
# undef __cdecl
8683
# if defined(__i386__) && defined(__GNUC__)
8784
# if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2)) || defined(__APPLE__)
@@ -92,15 +89,13 @@ extern "C" {
9289
# else
9390
# define __cdecl __stdcall
9491
# endif
95-
#endif
96-
97-
#if !defined(_MSC_VER) && !defined(__fastcall)
98-
# define __fastcall __stdcall
99-
#endif
100-
101-
#if (!defined(_MSC_VER) || !defined(__clang__)) && !defined(__thiscall)
102-
# define __thiscall __stdcall
103-
#endif
92+
# ifndef __fastcall
93+
# define __fastcall __stdcall
94+
# endif
95+
# ifndef __thiscall
96+
# define __thiscall __stdcall
97+
# endif
98+
#endif /* _MSC_VER || __MINGW32__ */
10499

105100
#ifndef __ms_va_list
106101
# if (defined(__x86_64__) || (defined(__aarch64__) && __has_attribute(ms_abi))) && defined (__GNUC__)

0 commit comments

Comments
 (0)