Make buildable with default main() function for Qt5 under Windows

This commit is contained in:
maxvodo 2015-12-07 11:06:30 +03:00
parent 84d1c080d6
commit 6cf8f3af1c

View File

@ -8,17 +8,29 @@
#ifndef TWOBLUECUBES_CATCH_DEFAULT_MAIN_HPP_INCLUDED #ifndef TWOBLUECUBES_CATCH_DEFAULT_MAIN_HPP_INCLUDED
#define 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__ #ifndef __OBJC__
// Standard C/C++ main entry point // 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 ); return Catch::Session().run( argc, argv );
} }
#else // __OBJC__ #else // __OBJC__
// Objective-C entry point // 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 #if !CATCH_ARC_ENABLED
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
#endif #endif