Merge pull request #86 from ledocc/remove_boost_deprecations

Remove boost deprecations 2
This commit is contained in:
Mathieu Champlon 2020-06-02 12:37:18 -05:00 committed by GitHub
commit 9dcdcf9061
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 5 deletions

View file

@ -19,7 +19,11 @@
#include <boost/type_traits/common_type.hpp> #include <boost/type_traits/common_type.hpp>
#include <boost/type_traits/is_convertible.hpp> #include <boost/type_traits/is_convertible.hpp>
#include <boost/type_traits/has_equal_to.hpp> #include <boost/type_traits/has_equal_to.hpp>
#if BOOST_VERSION >= 107000
#include <boost/test/tools/floating_point_comparison.hpp>
#else
#include <boost/test/floating_point_comparison.hpp> #include <boost/test/floating_point_comparison.hpp>
#endif
namespace mock namespace mock
{ {

View file

@ -14,7 +14,16 @@
#include <boost/algorithm/string/replace.hpp> #include <boost/algorithm/string/replace.hpp>
#include <boost/algorithm/string/erase.hpp> #include <boost/algorithm/string/erase.hpp>
#include <boost/algorithm/string/trim.hpp> #include <boost/algorithm/string/trim.hpp>
#include <boost/detail/sp_typeinfo.hpp> #include <boost/version.hpp>
#if BOOST_VERSION >= 107000
# include <boost/core/typeinfo.hpp>
# define MOCK_TYPEID( t ) BOOST_CORE_TYPEID(t)
# define MOCK_TYPEINFO boost::core::typeinfo
#else
# include <boost/detail/sp_typeinfo.hpp>
# define MOCK_TYPEID( t ) BOOST_SP_TYPEID(t)
# define MOCK_TYPEINFO boost::detail::sp_typeinfo
#endif
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#include <stdexcept> #include <stdexcept>
#include <typeinfo> #include <typeinfo>
@ -24,7 +33,7 @@
#include <cstdlib> #include <cstdlib>
#endif #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 namespace mock
{ {
@ -33,7 +42,7 @@ namespace detail
class type_name class type_name
{ {
public: public:
explicit type_name( const boost::detail::sp_typeinfo& info ) explicit type_name( const MOCK_TYPEINFO& info )
: info_( &info ) : info_( &info )
{} {}
friend std::ostream& operator<<( std::ostream& s, const type_name& t ) friend std::ostream& operator<<( std::ostream& s, const type_name& t )
@ -43,7 +52,7 @@ namespace detail
} }
private: private:
void serialize( std::ostream& s, void serialize( std::ostream& s,
const boost::detail::sp_typeinfo& info ) const const MOCK_TYPEINFO& info ) const
{ {
const char* name = info.name(); const char* name = info.name();
#ifdef __GNUC__ #ifdef __GNUC__
@ -108,7 +117,7 @@ namespace detail
return std::string::npos; return std::string::npos;
} }
const boost::detail::sp_typeinfo* info_; const MOCK_TYPEINFO* info_;
}; };
} }
} // mock } // mock