diff --git a/test/detail/test_function.cpp b/test/detail/test_function.cpp index fa5b000..66c27b1 100644 --- a/test/detail/test_function.cpp +++ b/test/detail/test_function.cpp @@ -349,7 +349,7 @@ BOOST_FIXTURE_TEST_CASE( triggering_an_expectation_with_failing_custom_constrain // CHECK_CALLS( 1 ); //} -#if !defined(BOOST_NO_CXX11_NULLPTR) && !defined(BOOST_NO_NULLPTR) +#ifdef MOCK_NULLPTR BOOST_FIXTURE_TEST_CASE( nullptr_can_be_used_in_place_of_null_pointers_in_constraints, error_fixture ) { diff --git a/test/test_constraints.cpp b/test/test_constraints.cpp index dc945d8..f9d5fad 100644 --- a/test/test_constraints.cpp +++ b/test/test_constraints.cpp @@ -78,7 +78,7 @@ BOOST_AUTO_TEST_CASE( same_constraint ) BOOST_CHECK( ! c.c_( j ) ); BOOST_CHECK( c.c_( i ) ); } -#if !defined(BOOST_NO_CXX11_NULLPTR) && !defined(BOOST_NO_NULLPTR) +#ifdef MOCK_NULLPTR { std::nullptr_t p; BOOST_CHECK( mock::same( p ).c_( p ) ); @@ -211,7 +211,7 @@ BOOST_AUTO_TEST_CASE( retrieve_constraint ) BOOST_CHECK( mock::retrieve( boost::ref( i ) ).c_( j ) ); BOOST_CHECK_EQUAL( i, &j ); } -#if !defined(BOOST_NO_CXX11_NULLPTR) && !defined(BOOST_NO_NULLPTR) +#ifdef MOCK_NULLPTR { std::nullptr_t* i = 0; std::nullptr_t j; diff --git a/test/test_log.cpp b/test/test_log.cpp index 0241539..a48ef05 100644 --- a/test/test_log.cpp +++ b/test/test_log.cpp @@ -631,7 +631,7 @@ BOOST_AUTO_TEST_CASE( boost_lambda_functor_yields_question_mark_when_serialized BOOST_CHECK_EQUAL( "?", to_string( boost::lambda::_1 < 42 ) ); } -#if !defined(BOOST_NO_CXX11_NULLPTR) && !defined(BOOST_NO_NULLPTR) +#ifdef MOCK_NULLPTR BOOST_AUTO_TEST_CASE( nullptr_is_serialized ) { diff --git a/turtle/config.hpp b/turtle/config.hpp index 194c211..173c5b9 100644 --- a/turtle/config.hpp +++ b/turtle/config.hpp @@ -53,6 +53,12 @@ # endif #endif +#if !defined(BOOST_NO_CXX11_NULLPTR) && !defined(BOOST_NO_NULLPTR) +# ifndef MOCK_NO_NULLPTR +# define MOCK_NULLPTR +# endif +#endif + #if !defined(BOOST_NO_CXX11_DECLTYPE) && !defined(BOOST_NO_DECLTYPE) # ifndef MOCK_NO_DECLTYPE # define MOCK_DECLTYPE diff --git a/turtle/detail/addressof.hpp b/turtle/detail/addressof.hpp index 66b54c1..a818945 100644 --- a/turtle/detail/addressof.hpp +++ b/turtle/detail/addressof.hpp @@ -9,6 +9,7 @@ #ifndef MOCK_ADDRESSOF_HPP_INCLUDED #define MOCK_ADDRESSOF_HPP_INCLUDED +#include "../config.hpp" #include namespace mock @@ -17,7 +18,7 @@ namespace detail { using boost::addressof; -#if !defined(BOOST_NO_CXX11_NULLPTR) && !defined(BOOST_NO_NULLPTR) +#ifdef MOCK_NULLPTR inline const std::nullptr_t* addressof( const std::nullptr_t& p ) { diff --git a/turtle/log.hpp b/turtle/log.hpp index c114c9f..167529b 100644 --- a/turtle/log.hpp +++ b/turtle/log.hpp @@ -137,7 +137,7 @@ namespace detail { return s << '?'; } -#if !defined(BOOST_NO_CXX11_NULLPTR) && !defined(BOOST_NO_NULLPTR) +#ifdef MOCK_NULLPTR inline stream& operator<<( stream& s, std::nullptr_t ) { return s << "nullptr";