2013-04-16 23:55:31 +02:00
|
|
|
/*
|
|
|
|
* Created by Phil on 15/04/2013.
|
|
|
|
* Copyright 2013 Two Blue Cubes Ltd. All rights reserved.
|
|
|
|
*
|
|
|
|
* Distributed under the Boost Software License, Version 1.0. (See accompanying
|
|
|
|
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
|
|
*/
|
|
|
|
#ifndef TWOBLUECUBES_CATCH_COMPILER_CAPABILITIES_HPP_INCLUDED
|
|
|
|
#define TWOBLUECUBES_CATCH_COMPILER_CAPABILITIES_HPP_INCLUDED
|
|
|
|
|
|
|
|
// Much of the following code is based on Boost (1.53)
|
|
|
|
|
2013-12-14 15:32:26 +01:00
|
|
|
#ifdef __clang__
|
|
|
|
|
2014-04-23 19:19:19 +02:00
|
|
|
# if __has_feature(cxx_nullptr)
|
|
|
|
# define CATCH_CONFIG_CPP11_NULLPTR
|
|
|
|
# endif
|
2013-12-14 15:32:26 +01:00
|
|
|
|
2014-04-23 19:19:19 +02:00
|
|
|
# if __has_feature(cxx_noexcept)
|
|
|
|
# define CATCH_CONFIG_CPP11_NOEXCEPT
|
|
|
|
# endif
|
2013-12-14 15:32:26 +01:00
|
|
|
|
|
|
|
#endif // __clang__
|
|
|
|
|
2013-04-16 23:55:31 +02:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Borland
|
|
|
|
#ifdef __BORLANDC__
|
|
|
|
|
|
|
|
#if (__BORLANDC__ > 0x582 )
|
2013-04-22 09:19:17 +02:00
|
|
|
//#define CATCH_CONFIG_SFINAE // Not confirmed
|
2013-04-16 23:55:31 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif // __BORLANDC__
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// EDG
|
|
|
|
#ifdef __EDG_VERSION__
|
|
|
|
|
|
|
|
#if (__EDG_VERSION__ > 238 )
|
2013-04-22 09:19:17 +02:00
|
|
|
//#define CATCH_CONFIG_SFINAE // Not confirmed
|
2013-04-16 23:55:31 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif // __EDG_VERSION__
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Digital Mars
|
|
|
|
#ifdef __DMC__
|
|
|
|
|
|
|
|
#if (__DMC__ > 0x840 )
|
2013-04-22 09:19:17 +02:00
|
|
|
//#define CATCH_CONFIG_SFINAE // Not confirmed
|
2013-04-16 23:55:31 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif // __DMC__
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// GCC
|
|
|
|
#ifdef __GNUC__
|
|
|
|
|
|
|
|
#if __GNUC__ < 3
|
|
|
|
|
|
|
|
#if (__GNUC_MINOR__ >= 96 )
|
2013-04-22 23:20:42 +02:00
|
|
|
//#define CATCH_CONFIG_SFINAE
|
2013-04-16 23:55:31 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#elif __GNUC__ >= 3
|
|
|
|
|
2013-04-22 09:19:17 +02:00
|
|
|
// #define CATCH_CONFIG_SFINAE // Taking this out completely for now
|
2013-04-16 23:55:31 +02:00
|
|
|
|
|
|
|
#endif // __GNUC__ < 3
|
|
|
|
|
2013-12-15 00:04:06 +01:00
|
|
|
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6 && defined(__GXX_EXPERIMENTAL_CXX0X__) )
|
2013-12-14 15:32:26 +01:00
|
|
|
|
|
|
|
#define CATCH_CONFIG_CPP11_NULLPTR
|
|
|
|
#endif
|
|
|
|
|
2013-04-16 23:55:31 +02:00
|
|
|
|
|
|
|
#endif // __GNUC__
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Visual C++
|
|
|
|
#ifdef _MSC_VER
|
|
|
|
|
2014-09-18 19:23:47 +02:00
|
|
|
#if (_MSC_VER >= 1600)
|
|
|
|
#define CATCH_CONFIG_CPP11_NULLPTR
|
|
|
|
#endif
|
|
|
|
|
2013-04-16 23:55:31 +02:00
|
|
|
#if (_MSC_VER >= 1310 ) // (VC++ 7.0+)
|
2013-04-22 09:19:17 +02:00
|
|
|
//#define CATCH_CONFIG_SFINAE // Not confirmed
|
2013-04-16 23:55:31 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif // _MSC_VER
|
|
|
|
|
2013-04-22 09:19:17 +02:00
|
|
|
// Use variadic macros if the compiler supports them
|
|
|
|
#if ( defined _MSC_VER && _MSC_VER > 1400 && !defined __EDGE__) || \
|
|
|
|
( defined __WAVE__ && __WAVE_HAS_VARIADICS ) || \
|
|
|
|
( defined __GNUC__ && __GNUC__ >= 3 ) || \
|
|
|
|
( !defined __cplusplus && __STDC_VERSION__ >= 199901L || __cplusplus >= 201103L )
|
2013-05-14 20:31:21 +02:00
|
|
|
|
|
|
|
#ifndef CATCH_CONFIG_NO_VARIADIC_MACROS
|
|
|
|
#define CATCH_CONFIG_VARIADIC_MACROS
|
|
|
|
#endif
|
|
|
|
|
2013-04-22 09:19:17 +02:00
|
|
|
#endif
|
2013-04-16 23:55:31 +02:00
|
|
|
|
2014-03-20 12:48:19 +01:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// C++ language feature support
|
|
|
|
|
|
|
|
// detect language version:
|
|
|
|
#if (__cplusplus == 201103L)
|
|
|
|
# define CATCH_CPP11
|
|
|
|
# define CATCH_CPP11_OR_GREATER
|
|
|
|
#elif (__cplusplus >= 201103L)
|
|
|
|
# define CATCH_CPP11_OR_GREATER
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// noexcept support:
|
2014-04-23 19:19:19 +02:00
|
|
|
#if defined(CATCH_CONFIG_CPP11_NOEXCEPT) && !defined(CATCH_NOEXCEPT)
|
|
|
|
# define CATCH_NOEXCEPT noexcept
|
|
|
|
# define CATCH_NOEXCEPT_IS(x) noexcept(x)
|
|
|
|
#else
|
2014-03-20 12:48:19 +01:00
|
|
|
# define CATCH_NOEXCEPT throw()
|
|
|
|
# define CATCH_NOEXCEPT_IS(x)
|
|
|
|
#endif
|
|
|
|
|
2013-04-16 23:55:31 +02:00
|
|
|
#endif // TWOBLUECUBES_CATCH_COMPILER_CAPABILITIES_HPP_INCLUDED
|
|
|
|
|