Skip to content

Commit

Permalink
Specify __cdecl on wmain, as required by x86 (fixes catchorg#2486).
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmatson committed Jul 25, 2022
1 parent 20d413b commit b3737c0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/own-main.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ If you just need to have code that executes before and/ or after Catch this is t
#define CATCH_CONFIG_RUNNER
#include "catch.hpp"

int main( int argc, char* argv[] ) {
extern "C" __cdecl int main( int argc, char* argv[] ) {
// global setup...

int result = Catch::Session().run( argc, argv );
Expand Down
2 changes: 1 addition & 1 deletion include/internal/catch_default_main.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

#if defined(CATCH_CONFIG_WCHAR) && defined(CATCH_PLATFORM_WINDOWS) && defined(_UNICODE) && !defined(DO_NOT_USE_WMAIN)
// Standard C/C++ Win32 Unicode wmain entry point
extern "C" int wmain (int argc, wchar_t * argv[], wchar_t * []) {
extern "C" int __cdecl wmain (int argc, wchar_t * argv[], wchar_t * []) {
#else
// Standard C/C++ main entry point
int main (int argc, char * argv[]) {
Expand Down

0 comments on commit b3737c0

Please sign in to comment.