diff options
Diffstat (limited to 'common/util.h')
-rw-r--r-- | common/util.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/common/util.h b/common/util.h index 52e4295bbb..699653918a 100644 --- a/common/util.h +++ b/common/util.h @@ -63,6 +63,20 @@ template<typename T> inline void SWAP(T &a, T &b) { T tmp = a; a = b; b = tmp; } #define ARRAYSIZE(x) ((int)(sizeof(x) / sizeof(x[0]))) +/** + * @def SCUMMVM_CURRENT_FUNCTION + * This macro evaluates to the current function's name on compilers supporting this. + */ +#if defined(__GNUC__) +# define SCUMMVM_CURRENT_FUNCTION __PRETTY_FUNCTION__ +#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901) +# define SCUMMVM_CURRENT_FUNCTION __func__ +#elif defined(_MSC_VER) && _MSC_VER >= 1300 +# define SCUMMVM_CURRENT_FUNCTION __FUNCTION__ +#else +# define SCUMMVM_CURRENT_FUNCTION "<unknown>" +#endif + namespace Common { /** |