From df5bb8cf3c03ca6c57b6ab5d7c6a6e15bd40400f Mon Sep 17 00:00:00 2001 From: mat007 Date: Wed, 14 Aug 2013 09:55:58 +0000 Subject: [PATCH] Added workaround for when msvc defines small and near macros git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@688 860be788-9bd5-4423-9f1e-828f051e677b --- turtle/constraints.hpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/turtle/constraints.hpp b/turtle/constraints.hpp index f18672d..40ded8e 100644 --- a/turtle/constraints.hpp +++ b/turtle/constraints.hpp @@ -30,8 +30,16 @@ namespace mock MOCK_NARY_CONSTRAINT( less_equal, 1, ( expected ), actual <= expected ) MOCK_NARY_CONSTRAINT( greater_equal, 1, ( expected ), actual >= expected ) +#ifdef BOOST_MSVC +# pragma push_macro( "small" ) +# undef small +#endif MOCK_NARY_CONSTRAINT( small, 1, ( expected ), \ ( boost::test_tools::check_is_small( actual, expected ) ) ) +#ifdef BOOST_MSVC +# pragma pop_macro( "small" ) +#endif + MOCK_NARY_CONSTRAINT( close, 2, ( expected, tolerance ), \ ( boost::test_tools::check_is_close( \ actual, expected, \ @@ -40,8 +48,16 @@ namespace mock ( boost::test_tools::check_is_close( \ actual, expected, \ boost::test_tools::fraction_tolerance( tolerance ) ) ) ) + +#ifdef BOOST_MSVC +# pragma push_macro( "near" ) +# undef near +#endif MOCK_NARY_CONSTRAINT( near, 2, ( expected, tolerance ), \ std::abs( actual - expected ) < tolerance ) +#ifdef BOOST_MSVC +# pragma pop_macro( "near" ) +#endif namespace detail {