From 13cf400e825c8c07ed4de9b9492805ebdede35a2 Mon Sep 17 00:00:00 2001 From: mat007 Date: Wed, 11 May 2011 16:01:06 +0000 Subject: [PATCH] Refactoring git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@320 860be788-9bd5-4423-9f1e-828f051e677b --- src/libraries/turtle/config.hpp | 25 +++++++++++++------------ src/libraries/turtle/lambda.hpp | 12 ++++++------ 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/src/libraries/turtle/config.hpp b/src/libraries/turtle/config.hpp index 3bf42f0..582a695 100644 --- a/src/libraries/turtle/config.hpp +++ b/src/libraries/turtle/config.hpp @@ -9,27 +9,28 @@ #ifndef MOCK_CONFIG_HPP_INCLUDED #define MOCK_CONFIG_HPP_INCLUDED -#include +#include +#include #ifndef MOCK_MAX_ARGS # define MOCK_MAX_ARGS 9 +#elif BOOST_PP_LESS(9, MOCK_MAX_ARGS) +# define MOCK_USE_BOOST_PHOENIX #endif #define MOCK_NUM_ARGS BOOST_PP_INC(MOCK_MAX_ARGS) -#if defined(MOCK_USE_BOOST_PHOENIX) || (MOCK_MAX_ARGS > 9) -# ifndef PHOENIX_LIMIT -# define PHOENIX_LIMIT MOCK_MAX_ARGS -# elif (PHOENIX_LIMIT < MOCK_MAX_ARGS) -# error PHOENIX_LIMIT must be set to MOCK_MAX_ARGS or higher -# endif -#else -# define MOCK_USE_BOOST_BIND -#endif - #ifndef BOOST_FUNCTION_MAX_ARGS # define BOOST_FUNCTION_MAX_ARGS MOCK_MAX_ARGS -#elif (BOOST_FUNCTION_MAX_ARGS < MOCK_MAX_ARGS) +#elif BOOST_PP_LESS(BOOST_FUNCTION_MAX_ARGS, MOCK_MAX_ARGS) # error BOOST_FUNCTION_MAX_ARGS must be set to MOCK_MAX_ARGS or higher #endif +#ifdef MOCK_USE_BOOST_PHOENIX +# ifndef PHOENIX_LIMIT +# define PHOENIX_LIMIT MOCK_MAX_ARGS +# elif BOOST_PP_LESS(PHOENIX_LIMIT, MOCK_MAX_ARGS) +# error PHOENIX_LIMIT must be set to MOCK_MAX_ARGS or higher +# endif +#endif + #endif // MOCK_CONFIG_HPP_INCLUDED diff --git a/src/libraries/turtle/lambda.hpp b/src/libraries/turtle/lambda.hpp index 03078d6..b21a180 100644 --- a/src/libraries/turtle/lambda.hpp +++ b/src/libraries/turtle/lambda.hpp @@ -10,10 +10,10 @@ #define MOCK_LAMBDA_HPP_INCLUDED #include "config.hpp" -#ifdef MOCK_USE_BOOST_BIND -#include -#else +#ifdef MOCK_USE_BOOST_PHOENIX #include +#else +#include #endif #include @@ -21,10 +21,10 @@ namespace mock { namespace detail { -#ifdef MOCK_USE_BOOST_BIND - using boost::bind; -#else +#ifdef MOCK_USE_BOOST_PHOENIX using boost::phoenix::bind; +#else + using boost::bind; #endif template< typename Result, typename Signature >