More pretty looking macros.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2015-09-14 10:30:14 +03:00
parent 7e2082fc0a
commit 48d4ed5905

View File

@ -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 */