current_function.hpp 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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 (c) 2002 Peter Dimov and Multi Media Ltd.
  11. //
  12. // Distributed under the Boost Software License, Version 1.0. (See
  13. // 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/utility/current_function.html
  17. //
  18. namespace boost
  19. {
  20. namespace detail
  21. {
  22. inline void current_function_helper()
  23. {
  24. #if defined(__GNUC__) || (defined(__MWERKS__) && (__MWERKS__ >= 0x3000)) || (defined(__ICC) && (__ICC >= 600))
  25. # define BOOST_CURRENT_FUNCTION __PRETTY_FUNCTION__
  26. #elif defined(__DMC__) && (__DMC__ >= 0x810)
  27. # define BOOST_CURRENT_FUNCTION __PRETTY_FUNCTION__
  28. #elif defined(__FUNCSIG__)
  29. # define BOOST_CURRENT_FUNCTION __FUNCSIG__
  30. #elif (defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 600)) || (defined(__IBMCPP__) && (__IBMCPP__ >= 500))
  31. # define BOOST_CURRENT_FUNCTION __FUNCTION__
  32. #elif defined(__BORLANDC__) && (__BORLANDC__ >= 0x550)
  33. # define BOOST_CURRENT_FUNCTION __FUNC__
  34. #elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901)
  35. # define BOOST_CURRENT_FUNCTION __func__
  36. #else
  37. # define BOOST_CURRENT_FUNCTION "(unknown)"
  38. #endif
  39. }
  40. } // namespace detail
  41. } // namespace boost
  42. #endif // #ifndef BOOST_CURRENT_FUNCTION_HPP_INCLUDED