diff --git a/include/turtle/constraints.hpp b/include/turtle/constraints.hpp index a24ee04..c17320f 100644 --- a/include/turtle/constraints.hpp +++ b/include/turtle/constraints.hpp @@ -19,7 +19,11 @@ #include #include #include +#if BOOST_VERSION >= 107000 +#include +#else #include +#endif namespace mock { diff --git a/include/turtle/detail/type_name.hpp b/include/turtle/detail/type_name.hpp index 8867d81..8264601 100644 --- a/include/turtle/detail/type_name.hpp +++ b/include/turtle/detail/type_name.hpp @@ -14,7 +14,16 @@ #include #include #include -#include +#include +#if BOOST_VERSION >= 107000 +# include +# define MOCK_TYPEID( t ) BOOST_CORE_TYPEID(t) +# define MOCK_TYPEINFO boost::core::typeinfo +#else +# include +# define MOCK_TYPEID( t ) BOOST_SP_TYPEID(t) +# define MOCK_TYPEINFO boost::detail::sp_typeinfo +#endif #include #include #include @@ -24,7 +33,7 @@ #include #endif -#define MOCK_TYPE_NAME( t ) mock::detail::type_name( BOOST_SP_TYPEID(t) ) +#define MOCK_TYPE_NAME( t ) mock::detail::type_name( MOCK_TYPEID(t) ) namespace mock { @@ -33,7 +42,7 @@ namespace detail class type_name { public: - explicit type_name( const boost::detail::sp_typeinfo& info ) + explicit type_name( const MOCK_TYPEINFO& info ) : info_( &info ) {} friend std::ostream& operator<<( std::ostream& s, const type_name& t ) @@ -43,7 +52,7 @@ namespace detail } private: void serialize( std::ostream& s, - const boost::detail::sp_typeinfo& info ) const + const MOCK_TYPEINFO& info ) const { const char* name = info.name(); #ifdef __GNUC__ @@ -108,7 +117,7 @@ namespace detail return std::string::npos; } - const boost::detail::sp_typeinfo* info_; + const MOCK_TYPEINFO* info_; }; } } // mock