From c8b4c922a596d26265a61e7a65a0c88694991460 Mon Sep 17 00:00:00 2001 From: David Grayson Date: Fri, 24 Jul 2015 13:48:58 -0700 Subject: [PATCH] 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. --- include/internal/catch_compiler_capabilities.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/internal/catch_compiler_capabilities.h b/include/internal/catch_compiler_capabilities.h index a5847545..0e5a6f43 100644 --- a/include/internal/catch_compiler_capabilities.h +++ b/include/internal/catch_compiler_capabilities.h @@ -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