From 6cf8f3af1cbf385997901a3f7d46451b921c66bb Mon Sep 17 00:00:00 2001 From: maxvodo Date: Mon, 7 Dec 2015 11:06:30 +0300 Subject: [PATCH] Make buildable with default main() function for Qt5 under Windows --- include/internal/catch_default_main.hpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/include/internal/catch_default_main.hpp b/include/internal/catch_default_main.hpp index b7b65a5b..5b8f3529 100644 --- a/include/internal/catch_default_main.hpp +++ b/include/internal/catch_default_main.hpp @@ -8,17 +8,29 @@ #ifndef TWOBLUECUBES_CATCH_DEFAULT_MAIN_HPP_INCLUDED #define TWOBLUECUBES_CATCH_DEFAULT_MAIN_HPP_INCLUDED +#include "catch_platform.h" + +#ifndef CATCH_PLATFORM_WINDOWS + #ifndef CATCH_CONFIG_MAIN_ARGV_TYPE + #define CATCH_CONFIG_MAIN_ARGV_TYPE char * const + #endif +#else + #ifndef CATCH_CONFIG_MAIN_ARGV_TYPE + #define CATCH_CONFIG_MAIN_ARGV_TYPE char * + #endif +#endif + #ifndef __OBJC__ // Standard C/C++ main entry point -int main (int argc, char * const argv[]) { +int main (int argc, CATCH_CONFIG_MAIN_ARGV_TYPE argv[]) { return Catch::Session().run( argc, argv ); } #else // __OBJC__ // Objective-C entry point -int main (int argc, char * const argv[]) { +int main (int argc, CATCH_CONFIG_MAIN_ARGV_TYPE argv[]) { #if !CATCH_ARC_ENABLED NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; #endif