From 48d4ed59053382da8159f33ad3c0ff4575bc083f Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 14 Sep 2015 10:30:14 +0300 Subject: [PATCH] More pretty looking macros. --HG-- branch : develop --- src/libs/vmisc/def.h | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/src/libs/vmisc/def.h b/src/libs/vmisc/def.h index 2d4b4b016..d2b0cf9cd 100644 --- a/src/libs/vmisc/def.h +++ b/src/libs/vmisc/def.h @@ -162,31 +162,23 @@ enum class GSizes : unsigned char { ALL, * https://stackoverflow.com/questions/1721543/continue-to-debug-after-failed-assertion-on-linux-c-c */ #ifndef V_NO_ASSERT + #ifdef Q_CC_MSVC -#define SCASSERT(cond) \ -{ \ - if (!(cond)) \ - { \ - qDebug("ASSERT: %s in %s (%s:%u)", \ - #cond, __FUNCSIG__, __FILE__, __LINE__); \ - debug_break(); \ - } \ -} \ - +#define V_PRETTY_FUNCTION __FUNCSIG__ #else // GCC/Clang +#define V_PRETTY_FUNCTION __PRETTY_FUNCTION__ +#endif /*Q_CC_MSVC*/ #define SCASSERT(cond) \ { \ if (!(cond)) \ { \ qDebug("ASSERT: %s in %s (%s:%u)", \ - #cond, __PRETTY_FUNCTION__, __FILE__, __LINE__);\ + #cond, V_PRETTY_FUNCTION, __FILE__, __LINE__); \ debug_break(); \ } \ } \ -#endif /*Q_CC_MSVC*/ - #else // define but disable this function if debugging is not set #define SCASSERT(cond) qt_noop(); #endif /* V_NO_ASSERT */