staticlib_config  1.1.1
 All Classes Namespaces Files Functions Macros
current_function.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 2015, alex at staticlibs.net
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 /*
18  * File: current_function.hpp
19  * Author: alex
20  *
21  * Created on November 21, 2015, 8:45 PM
22  */
23 
24 #ifndef STATICLIB_CONFIG_CURRENT_FUNCTION_HPP
25 #define STATICLIB_CONFIG_CURRENT_FUNCTION_HPP
26 
27 // https://github.com/boostorg/assert/blob/94ebde8bcff31752b7ffe7fcd58ad4d783bf958c/include/boost/current_function.hpp
28 #if defined(__GNUC__) || (defined(__MWERKS__) && (__MWERKS__ >= 0x3000)) || (defined(__ICC) && (__ICC >= 600)) || defined(__ghs__)
29 #define STATICLIB_CURRENT_FUNCTION __PRETTY_FUNCTION__
30 #elif defined(__DMC__) && (__DMC__ >= 0x810)
31 #define STATICLIB_CURRENT_FUNCTION __PRETTY_FUNCTION__
32 #elif defined(__FUNCSIG__)
33 #define STATICLIB_CURRENT_FUNCTION __FUNCSIG__
34 #elif (defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 600)) || (defined(__IBMCPP__) && (__IBMCPP__ >= 500))
35 #define STATICLIB_CURRENT_FUNCTION __FUNCTION__
36 #elif defined(__BORLANDC__) && (__BORLANDC__ >= 0x550)
37 #define STATICLIB_CURRENT_FUNCTION __FUNC__
38 #elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901)
39 #define STATICLIB_CURRENT_FUNCTION __func__
40 #elif defined(__cplusplus) && (__cplusplus >= 201103)
41 #define STATICLIB_CURRENT_FUNCTION __func__
42 #else
43 #define STATICLIB_CURRENT_FUNCTION "(unknown)"
44 #endif
45 
46 #endif /* STATICLIB_CONFIG_CURRENT_FUNCTION_HPP */