current_function.hpp 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. #ifndef BOOST_CURRENT_FUNCTION_HPP_INCLUDED
  2. #define BOOST_CURRENT_FUNCTION_HPP_INCLUDED
  3. // MS compatible compilers support #pragma once
  4. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  5. # pragma once
  6. #endif
  7. //
  8. // boost/current_function.hpp - BOOST_CURRENT_FUNCTION
  9. //
  10. // Copyright 2002-2018 Peter Dimov
  11. //
  12. // Distributed under the Boost Software License, Version 1.0.
  13. // See accompanying file LICENSE_1_0.txt or copy at
  14. // http://www.boost.org/LICENSE_1_0.txt
  15. //
  16. // http://www.boost.org/libs/assert
  17. //
  18. namespace boost
  19. {
  20. namespace detail
  21. {
  22. inline void current_function_helper()
  23. {
  24. #if defined( BOOST_DISABLE_CURRENT_FUNCTION )
  25. # define BOOST_CURRENT_FUNCTION "(unknown)"
  26. #elif defined(__GNUC__) || (defined(__MWERKS__) && (__MWERKS__ >= 0x3000)) || (defined(__ICC) && (__ICC >= 600)) || defined(__ghs__) || defined(__clang__)
  27. # define BOOST_CURRENT_FUNCTION __PRETTY_FUNCTION__
  28. #elif defined(__DMC__) && (__DMC__ >= 0x810)
  29. # define BOOST_CURRENT_FUNCTION __PRETTY_FUNCTION__
  30. #elif defined(__FUNCSIG__)
  31. # define BOOST_CURRENT_FUNCTION __FUNCSIG__
  32. #elif (defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 600)) || (defined(__IBMCPP__) && (__IBMCPP__ >= 500))
  33. # define BOOST_CURRENT_FUNCTION __FUNCTION__
  34. #elif defined(__BORLANDC__) && (__BORLANDC__ >= 0x550)
  35. # define BOOST_CURRENT_FUNCTION __FUNC__
  36. #elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901)
  37. # define BOOST_CURRENT_FUNCTION __func__
  38. #elif defined(__cplusplus) && (__cplusplus >= 201103)
  39. # define BOOST_CURRENT_FUNCTION __func__
  40. #else
  41. # define BOOST_CURRENT_FUNCTION "(unknown)"
  42. #endif
  43. }
  44. } // namespace detail
  45. } // namespace boost
  46. #endif // #ifndef BOOST_CURRENT_FUNCTION_HPP_INCLUDED