Add Activ libs and includes (gcc123)
This commit is contained in:
1 parent
4b718994be
commit
7086753a10
10971 files changed
+2291714
No files matched your search
@@ -0,0 +1,121 @@
|
||||
#ifndef ACTIV_BOOST_ASSERT_SOURCE_LOCATION_HPP_INCLUDED
|
||||
#define ACTIV_BOOST_ASSERT_SOURCE_LOCATION_HPP_INCLUDED
|
||||
|
||||
// http://www.boost.org/libs/assert
|
||||
//
|
||||
// Copyright 2019, 2021 Peter Dimov
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <ActivBoost/current_function.hpp>
|
||||
#include <ActivBoost/config.hpp>
|
||||
#include <ActivBoost/cstdint.hpp>
|
||||
#include <iosfwd>
|
||||
#include <string>
|
||||
#include <cstdio>
|
||||
|
||||
namespace Boost
|
||||
{
|
||||
|
||||
struct source_location
|
||||
{
|
||||
private:
|
||||
|
||||
char const * file_;
|
||||
char const * function_;
|
||||
Boost::uint_least32_t line_;
|
||||
Boost::uint_least32_t column_;
|
||||
|
||||
public:
|
||||
|
||||
ACTIV_BOOST_CONSTEXPR source_location() ACTIV_BOOST_NOEXCEPT: file_( "(unknown)" ), function_( "(unknown)" ), line_( 0 ), column_( 0 )
|
||||
{
|
||||
}
|
||||
|
||||
ACTIV_BOOST_CONSTEXPR source_location( char const * file, Boost::uint_least32_t ln, char const * function, Boost::uint_least32_t col = 0 ) ACTIV_BOOST_NOEXCEPT: file_( file ), function_( function ), line_( ln ), column_( col )
|
||||
{
|
||||
}
|
||||
|
||||
ACTIV_BOOST_CONSTEXPR char const * file_name() const ACTIV_BOOST_NOEXCEPT
|
||||
{
|
||||
return file_;
|
||||
}
|
||||
|
||||
ACTIV_BOOST_CONSTEXPR char const * function_name() const ACTIV_BOOST_NOEXCEPT
|
||||
{
|
||||
return function_;
|
||||
}
|
||||
|
||||
ACTIV_BOOST_CONSTEXPR Boost::uint_least32_t line() const ACTIV_BOOST_NOEXCEPT
|
||||
{
|
||||
return line_;
|
||||
}
|
||||
|
||||
ACTIV_BOOST_CONSTEXPR Boost::uint_least32_t column() const ACTIV_BOOST_NOEXCEPT
|
||||
{
|
||||
return column_;
|
||||
}
|
||||
|
||||
#if defined(ACTIV_BOOST_MSVC)
|
||||
# pragma warning( push )
|
||||
# pragma warning( disable: 4996 )
|
||||
#endif
|
||||
|
||||
std::string to_string() const
|
||||
{
|
||||
if( line() == 0 )
|
||||
{
|
||||
return "(unknown source location)";
|
||||
}
|
||||
|
||||
std::string r = file_name();
|
||||
|
||||
char buffer[ 16 ];
|
||||
|
||||
std::sprintf( buffer, ":%ld", static_cast<long>( line() ) );
|
||||
r += buffer;
|
||||
|
||||
if( column() )
|
||||
{
|
||||
std::sprintf( buffer, ":%ld", static_cast<long>( column() ) );
|
||||
r += buffer;
|
||||
}
|
||||
|
||||
r += " in function '";
|
||||
r += function_name();
|
||||
r += '\'';
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
#if defined(ACTIV_BOOST_MSVC)
|
||||
# pragma warning( pop )
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
template<class E, class T> std::basic_ostream<E, T> & operator<<( std::basic_ostream<E, T> & os, source_location const & loc )
|
||||
{
|
||||
os << loc.to_string();
|
||||
return os;
|
||||
}
|
||||
|
||||
} // namespace Boost
|
||||
|
||||
#if defined( ACTIV_BOOST_DISABLE_CURRENT_LOCATION )
|
||||
|
||||
# define ACTIV_BOOST_CURRENT_LOCATION ::Boost::source_location()
|
||||
|
||||
#elif defined(__clang_analyzer__)
|
||||
|
||||
// Cast to char const* to placate clang-tidy
|
||||
// https://bugs.llvm.org/show_bug.cgi?id=28480
|
||||
# define ACTIV_BOOST_CURRENT_LOCATION ::Boost::source_location(__FILE__, __LINE__, static_cast<char const*>(ACTIV_BOOST_CURRENT_FUNCTION))
|
||||
|
||||
#else
|
||||
|
||||
# define ACTIV_BOOST_CURRENT_LOCATION ::Boost::source_location(__FILE__, __LINE__, ACTIV_BOOST_CURRENT_FUNCTION)
|
||||
|
||||
#endif
|
||||
|
||||
#endif // #ifndef ACTIV_BOOST_ASSERT_SOURCE_LOCATION_HPP_INCLUDED
|
||||
Reference in new issue
Block a user