-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Specify __cdecl on main/wmain, as required by x86 (fixes #2486). #2487
Conversation
Codecov Report
@@ Coverage Diff @@
## v2.x #2487 +/- ##
=======================================
Coverage 90.08% 90.08%
=======================================
Files 113 113
Lines 5040 5040
=======================================
Hits 4540 4540
Misses 500 500 |
b3737c0
to
71e695e
Compare
71e695e
to
e390b9b
Compare
I was gonna say that I am surprised this passes CI, but v2 used to use travis for non-Windows CI and that is dead. Sprinkling |
Done - thanks for taking a look! |
8fc2314
to
c136a8e
Compare
4732f4b
to
b12c7a8
Compare
@@ -13,12 +13,20 @@ | |||
|
|||
#ifndef __OBJC__ | |||
|
|||
#ifndef CATCH_INTERNAL_CDECL | |||
#ifdef _MSC_VER |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO it would be a good idea to additionally constrain this even more to just 32bit x86 with the predefined macro _M_IX86.
_M_IX86
Defined as the integer literal value 600 for compilations that target x86 processors. This macro isn't defined for x64 or ARM compilation targets.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the convention, when specifying __cdecl, is always to specify it though rather than making it arch-specific. (I believe the requirement is for all architectures, it's just technically no different on some so it doesn't cause a problem in practice if it's not there.)
For example:
"On ARM and x64 processors, __cdecl is accepted but typically ignored by the compiler."
https://docs.microsoft.com/en-us/cpp/cpp/cdecl?view=msvc-170
No description provided.