Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 1 | #ifndef NDNBOOST_CURRENT_FUNCTION_HPP_INCLUDED |
| 2 | #define NDNBOOST_CURRENT_FUNCTION_HPP_INCLUDED |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 3 | |
| 4 | // MS compatible compilers support #pragma once |
| 5 | |
| 6 | #if defined(_MSC_VER) && (_MSC_VER >= 1020) |
| 7 | # pragma once |
| 8 | #endif |
| 9 | |
| 10 | // |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 11 | // ndnboost/current_function.hpp - NDNBOOST_CURRENT_FUNCTION |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 12 | // |
| 13 | // Copyright (c) 2002 Peter Dimov and Multi Media Ltd. |
| 14 | // |
| 15 | // Distributed under the Boost Software License, Version 1.0. (See |
| 16 | // accompanying file LICENSE_1_0.txt or copy at |
| 17 | // http://www.boost.org/LICENSE_1_0.txt) |
| 18 | // |
| 19 | // http://www.boost.org/libs/utility/current_function.html |
| 20 | // |
| 21 | |
| 22 | namespace ndnboost |
| 23 | { |
| 24 | |
| 25 | namespace detail |
| 26 | { |
| 27 | |
| 28 | inline void current_function_helper() |
| 29 | { |
| 30 | |
| 31 | #if defined(__GNUC__) || (defined(__MWERKS__) && (__MWERKS__ >= 0x3000)) || (defined(__ICC) && (__ICC >= 600)) || defined(__ghs__) |
| 32 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 33 | # define NDNBOOST_CURRENT_FUNCTION __PRETTY_FUNCTION__ |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 34 | |
| 35 | #elif defined(__DMC__) && (__DMC__ >= 0x810) |
| 36 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 37 | # define NDNBOOST_CURRENT_FUNCTION __PRETTY_FUNCTION__ |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 38 | |
| 39 | #elif defined(__FUNCSIG__) |
| 40 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 41 | # define NDNBOOST_CURRENT_FUNCTION __FUNCSIG__ |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 42 | |
| 43 | #elif (defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 600)) || (defined(__IBMCPP__) && (__IBMCPP__ >= 500)) |
| 44 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 45 | # define NDNBOOST_CURRENT_FUNCTION __FUNCTION__ |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 46 | |
| 47 | #elif defined(__BORLANDC__) && (__BORLANDC__ >= 0x550) |
| 48 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 49 | # define NDNBOOST_CURRENT_FUNCTION __FUNC__ |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 50 | |
| 51 | #elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901) |
| 52 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 53 | # define NDNBOOST_CURRENT_FUNCTION __func__ |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 54 | |
| 55 | #else |
| 56 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 57 | # define NDNBOOST_CURRENT_FUNCTION "(unknown)" |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 58 | |
| 59 | #endif |
| 60 | |
| 61 | } |
| 62 | |
| 63 | } // namespace detail |
| 64 | |
| 65 | } // namespace ndnboost |
| 66 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 67 | #endif // #ifndef NDNBOOST_CURRENT_FUNCTION_HPP_INCLUDED |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 68 | |