mirror of
https://github.com/ZDoom/Raze.git
synced 2025-01-18 14:41:55 +00:00
compat.h: Upgrade EDUKE32_FUNCTION and add EDUKE32_PRETTY_FUNCTION.
git-svn-id: https://svn.eduke32.com/eduke32@6077 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
62a921c409
commit
d6e820645b
1 changed files with 11 additions and 4 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue