Skip to content

Commit 95ebcfa

Browse files
Yuxuan Shuiivyl
authored andcommitted
Revert "include: Don't align the stack for PE builds."
This reverts commit 87fbf33. We saw hangs in Phasmophobia with the commit, and then discovered this commit is not strictly necessary for ntlea, so we revert it.
1 parent 4fb9230 commit 95ebcfa

File tree

2 files changed

+20
-12
lines changed

2 files changed

+20
-12
lines changed

include/msvcrt/corecrt.h

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

85-
#if !defined(_MSC_VER) && !defined(__MINGW32__)
85+
#ifndef _MSC_VER
8686
# undef __stdcall
8787
# ifdef __i386__
8888
# ifdef __GNUC__
@@ -100,13 +100,16 @@
100100
# else
101101
# define __stdcall __attribute__((ms_abi))
102102
# endif
103-
# elif defined(__arm__) && defined (__GNUC__) && !defined(__SOFTFP__) && !defined(__CYGWIN__)
103+
# elif defined(__arm__) && defined (__GNUC__) && !defined(__SOFTFP__) && !defined(__MINGW32__) && !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
110113
# undef __cdecl
111114
# if defined(__i386__) && defined(__GNUC__)
112115
# if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2)) || defined(__APPLE__)
@@ -117,7 +120,7 @@
117120
# else
118121
# define __cdecl __stdcall
119122
# endif
120-
#endif /* _MSC_VER || __MINGW32__ */
123+
#endif
121124

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

include/windef.h

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ extern "C" {
5454
# endif
5555
#endif
5656

57-
#if !defined(_MSC_VER) && !defined(__MINGW32__)
57+
#ifndef _MSC_VER
5858
# undef __stdcall
5959
# ifdef __i386__
6060
# ifdef __GNUC__
@@ -72,13 +72,16 @@ extern "C" {
7272
# else
7373
# define __stdcall __attribute__((ms_abi))
7474
# endif
75-
# elif defined(__arm__) && defined (__GNUC__) && !defined(__SOFTFP__) && !defined(__CYGWIN__)
75+
# elif defined(__arm__) && defined (__GNUC__) && !defined(__SOFTFP__) && !defined(__MINGW32__) && !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
8285
# undef __cdecl
8386
# if defined(__i386__) && defined(__GNUC__)
8487
# if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2)) || defined(__APPLE__)
@@ -89,13 +92,15 @@ extern "C" {
8992
# else
9093
# define __cdecl __stdcall
9194
# endif
92-
# ifndef __fastcall
93-
# define __fastcall __stdcall
94-
# endif
95-
# ifndef __thiscall
96-
# define __thiscall __stdcall
97-
# endif
98-
#endif /* _MSC_VER || __MINGW32__ */
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
99104

100105
#ifndef __ms_va_list
101106
# if (defined(__x86_64__) || (defined(__aarch64__) && __has_attribute(ms_abi))) && defined (__GNUC__)

0 commit comments

Comments
 (0)