From d6e820645b62dff44af2a56aa1f09e315d77760a Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Sat, 25 Feb 2017 08:15:58 +0000 Subject: [PATCH] compat.h: Upgrade EDUKE32_FUNCTION and add EDUKE32_PRETTY_FUNCTION. git-svn-id: https://svn.eduke32.com/eduke32@6077 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/build/include/compat.h | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/source/build/include/compat.h b/source/build/include/compat.h index e3aa8968f..78c6159e3 100644 --- a/source/build/include/compat.h +++ b/source/build/include/compat.h @@ -120,15 +120,22 @@ #define EDUKE32_UNREACHABLE_SECTION(...) __VA_ARGS__ #endif -// Detection of __func__ or equivalent functionality, found in SDL_assert.h -#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 supports __func__ as a standard. */ -# define EDUKE32_FUNCTION __func__ -#elif ((__GNUC__ >= 2) || defined(_MSC_VER)) +#if EDUKE32_GCC_PREREQ(2,0) || defined _MSC_VER # define EDUKE32_FUNCTION __FUNCTION__ +#elif (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L) || (defined __cplusplus && __cplusplus >= 201103L) +# define EDUKE32_FUNCTION __func__ #else # define EDUKE32_FUNCTION "???" #endif +#ifdef _MSC_VER +# define EDUKE32_PRETTY_FUNCTION __FUNCSIG__ +#elif EDUKE32_GCC_PREREQ(2,0) +# define EDUKE32_PRETTY_FUNCTION __PRETTY_FUNCTION__ +#else +# define EDUKE32_PRETTY_FUNCTION EDUKE32_FUNCTION +#endif + /* Static assertions, based on source found in LuaJIT's src/lj_def.h. */ #define EDUKE32_ASSERT_NAME2(name, line) name ## line #define EDUKE32_ASSERT_NAME(line) EDUKE32_ASSERT_NAME2(eduke32_assert_, line)