GCC 5.2 only has nullptr if running in C++11 mode (or greater). Every

GCC since 4.7 has a __cplusplus macro we can check to see what version
of the C++ standard is being used.

This change preserves the logic that was used for GCC 4, but for GCC
versions greater than 4, we will assume it has nullptr if and only if
the __cplusplus macro is large enough.

This allows catch to work on GCC 5.2 when it is not running in C++11
mode.
This commit is contained in:
David Grayson 2015-07-24 13:48:58 -07:00
parent 74eef52644
commit c8b4c922a5
1 changed files with 1 additions and 1 deletions

View File

@ -67,7 +67,7 @@
// GCC
#ifdef __GNUC__
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6 && defined(__GXX_EXPERIMENTAL_CXX0X__) )
#if (__GNUC__ > 4 && __cplusplus >= 201103L) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6 && defined(__GXX_EXPERIMENTAL_CXX0X__) )
# define CATCH_INTERNAL_CONFIG_CPP11_NULLPTR
#endif