github.com/searKing/golang/go@v1.2.117/os/signal/cgo/include/boost/stacktrace/detail/unwind_base_impls.hpp (about)

     1  // Copyright Antony Polukhin, 2016-2023.
     2  //
     3  // Distributed under the Boost Software License, Version 1.0. (See
     4  // accompanying file LICENSE_1_0.txt or copy at
     5  // http://www.boost.org/LICENSE_1_0.txt)
     6  
     7  #ifndef BOOST_STACKTRACE_DETAIL_UNWIND_BASE_IMPLS_HPP
     8  #define BOOST_STACKTRACE_DETAIL_UNWIND_BASE_IMPLS_HPP
     9  
    10  #include <boost/config.hpp>
    11  #ifdef BOOST_HAS_PRAGMA_ONCE
    12  #   pragma once
    13  #endif
    14  
    15  #include <boost/stacktrace/frame.hpp>
    16  
    17  namespace boost { namespace stacktrace { namespace detail {
    18  
    19  struct to_string_using_nothing {
    20      std::string res;
    21  
    22      void prepare_function_name(const void* addr) {
    23          res = boost::stacktrace::frame(addr).name();
    24      }
    25  
    26      bool prepare_source_location(const void* /*addr*/) const noexcept {
    27          return false;
    28      }
    29  };
    30  
    31  template <class Base> class to_string_impl_base;
    32  typedef to_string_impl_base<to_string_using_nothing> to_string_impl;
    33  
    34  inline std::string name_impl(const void* /*addr*/) {
    35      return std::string();
    36  }
    37  
    38  } // namespace detail
    39  
    40  std::string frame::source_file() const {
    41      return std::string();
    42  }
    43  
    44  std::size_t frame::source_line() const {
    45      return 0;
    46  }
    47  
    48  }} // namespace boost::stacktrace
    49  
    50  #endif // BOOST_STACKTRACE_DETAIL_UNWIND_BASE_IMPLS_HPP