Remove srcloc_strip_top_level, because the contents of __PRETTY_FUNCTION__ aren't constant before GCC 9 and strcmp fails

This commit is contained in:
Peter Dimov
2022-02-05 00:06:29 +02:00
parent 7b14d83548
commit 8cb06e5d82

View File

@@ -123,20 +123,6 @@ template<class E, class T> std::basic_ostream<E, T> & operator<<( std::basic_ost
return os; return os;
} }
#if defined(BOOST_GCC)
namespace detail
{
BOOST_CONSTEXPR inline char const* srcloc_strip_top_level( char const* fn )
{
return std::strcmp( fn, "top level" ) == 0? "": fn;
}
} // namespace detail
#endif // #if defined(BOOST_GCC)
} // namespace boost } // namespace boost
#if defined(BOOST_DISABLE_CURRENT_LOCATION) #if defined(BOOST_DISABLE_CURRENT_LOCATION)
@@ -165,7 +151,7 @@ BOOST_CONSTEXPR inline char const* srcloc_strip_top_level( char const* fn )
#elif defined(BOOST_GCC) #elif defined(BOOST_GCC)
// __PRETTY_FUNCTION__ is allowed outside functions under GCC // __PRETTY_FUNCTION__ is allowed outside functions under GCC
# define BOOST_CURRENT_LOCATION ::boost::source_location(__FILE__, __LINE__, ::boost::detail::srcloc_strip_top_level(__PRETTY_FUNCTION__)) # define BOOST_CURRENT_LOCATION ::boost::source_location(__FILE__, __LINE__, __PRETTY_FUNCTION__)
#else #else