Modernize syntax of enable_if and traits to use _t helpers
[gromacs.git] / src / gromacs / utility / current_function.h
blob1408a33b87b422519b18e0df2d7b33fd5d598b3c
1 /*
2 * This file is part of the GROMACS molecular simulation package.
4 * Copyright (c) 2015, by the GROMACS development team, led by
5 * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
6 * and including many others, as listed in the AUTHORS file in the
7 * top-level source directory and at http://www.gromacs.org.
9 * GROMACS is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public License
11 * as published by the Free Software Foundation; either version 2.1
12 * of the License, or (at your option) any later version.
14 * GROMACS is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with GROMACS; if not, see
21 * http://www.gnu.org/licenses, or write to the Free Software Foundation,
22 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 * If you want to redistribute modifications to GROMACS, please
25 * consider that scientific software is very special. Version
26 * control is crucial - bugs must be traceable. We will be happy to
27 * consider code for inclusion in the official distribution, but
28 * derived work must not be called official GROMACS. Details are found
29 * in the README & COPYING files - if they are missing, get the
30 * official version at http://www.gromacs.org.
32 * To help us fund GROMACS development, we humbly ask that you cite
33 * the research papers on the package. Check out http://www.gromacs.org.
35 /*! \file
36 * \brief
37 * Declares GMX_CURRENT_FUNCTION for getting the current function name.
39 * The implementation is essentially copied from Boost 1.55 (see reference below).
41 * \ingroup module_utility
43 #ifndef GMX_UTILITY_CURRENT_FUNCTION_H
44 #define GMX_UTILITY_CURRENT_FUNCTION_H
46 /*! \def GMX_CURRENT_FUNCTION
47 * \brief
48 * Expands to a string that provides the name of the current function.
50 * \ingroup module_utility
54 // boost/current_function.hpp - BOOST_CURRENT_FUNCTION
56 // Copyright (c) 2002 Peter Dimov and Multi Media Ltd.
58 // Distributed under the Boost Software License, Version 1.0. (See
59 // accompanying file LICENSE_1_0.txt or copy at
60 // http://www.boost.org/LICENSE_1_0.txt)
62 // http://www.boost.org/libs/utility/current_function.html
65 namespace gmx
68 namespace internal
71 //! Helper for defining GMX_CURRENT_FUNCTION.
72 inline void current_function_helper()
75 #if defined(__GNUC__) || (defined(__MWERKS__) && (__MWERKS__ >= 0x3000)) || (defined(__ICC) && (__ICC >= 600)) || defined(__ghs__)
77 # define GMX_CURRENT_FUNCTION __PRETTY_FUNCTION__
79 #elif defined(__DMC__) && (__DMC__ >= 0x810)
81 # define GMX_CURRENT_FUNCTION __PRETTY_FUNCTION__
83 #elif defined(__FUNCSIG__)
85 # define GMX_CURRENT_FUNCTION __FUNCSIG__
87 #elif (defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 600)) || (defined(__IBMCPP__) && (__IBMCPP__ >= 500))
89 # define GMX_CURRENT_FUNCTION __FUNCTION__
91 #elif defined(__BORLANDC__) && (__BORLANDC__ >= 0x550)
93 # define GMX_CURRENT_FUNCTION __FUNC__
95 #elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901)
97 # define GMX_CURRENT_FUNCTION __func__
99 #else
101 # define GMX_CURRENT_FUNCTION "(unknown)"
103 #endif
107 } // namespace internal
109 } // namespace gmx
111 #endif