Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorMartin Hořeňovský2021-12-02 13:49:16 +0100
committerMartin Hořeňovský2021-12-02 13:49:16 +0100
commitc49faa62dd0bdc4f71412c63ef161b7231ae2ab4 (patch)
treede0ef527916c3053f63b0e4c50fcd00843189d5a /src
parentc0976091151c5f31769ac991ca748021253bdba3 (diff)
downloadcatch3-c49faa62dd0bdc4f71412c63ef161b7231ae2ab4.tar.gz
Let users of amalgamated distribution override the default main
Closes #2324
Diffstat (limited to 'src')
-rw-r--r--src/catch2/internal/catch_main.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/catch2/internal/catch_main.cpp b/src/catch2/internal/catch_main.cpp
index ed89ab6e..f523bbfa 100644
--- a/src/catch2/internal/catch_main.cpp
+++ b/src/catch2/internal/catch_main.cpp
@@ -18,6 +18,9 @@ namespace Catch {
CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION
}
+// Allow users of amalgamated .cpp file to remove our main and provide their own.
+#if !defined(CATCH_AMALGAMATED_CUSTOM_MAIN)
+
#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 __cdecl wmain (int argc, wchar_t * argv[], wchar_t * []) {
@@ -32,3 +35,5 @@ int main (int argc, char * argv[]) {
return Catch::Session().run( argc, argv );
}
+
+#endif // !defined(CATCH_AMALGAMATED_CUSTOM_MAIN