Scarab  v3.2.0
Project 8 C++ Utility Library
macros.hh
Go to the documentation of this file.
1 /*
2  * macros.hh
3  *
4  * Created on: May 25, 2017
5  * Author: obla999
6  */
7 
8 #ifndef SCARAB_UTILITY_MACROS_HH_
9 #define SCARAB_UTILITY_MACROS_HH_
10 
11 // Return value constants
12 #define RETURN_SUCCESS 0
13 #define RETURN_ERROR 1
14 #define RETURN_CANCELED 2
15 #define RETURN_REVOKED 3
16 
17 #define PASTE2( x, y ) x##y
18 #define PASTE( x, y ) PASTE2( x, y )
19 
20 #define STRINGIFY(x) #x
21 #define TOSTRING(x) STRINGIFY(x)
22 #define __FILE_LINE__ __FILE__ "(" TOSTRING(__LINE__) ")"
23 #define __FILENAME_LINE__ (strrchr(__FILE__, '/') ? strrchr(__FILE_LINE__, '/') + 1 : __FILE_LINE__)
24 
25 #if !defined(__FUNC__)
26 #if defined(_MSC_VER)
27 #define __FUNC__ __FUNCSIG__
28 #elif defined(__GNUC__)
29 #define __FUNC__ __PRETTY_FUNCTION__
30 #else
31 #define __FUNC__ ""
32 #endif
33 #endif
34 
35 #endif /* SCARAB_UTILITY_MACROS_HH_ */