More pretty looking macros.
--HG-- branch : develop
This commit is contained in:
parent
7e2082fc0a
commit
48d4ed5905
|
@ -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
|
* https://stackoverflow.com/questions/1721543/continue-to-debug-after-failed-assertion-on-linux-c-c
|
||||||
*/
|
*/
|
||||||
#ifndef V_NO_ASSERT
|
#ifndef V_NO_ASSERT
|
||||||
|
|
||||||
#ifdef Q_CC_MSVC
|
#ifdef Q_CC_MSVC
|
||||||
#define SCASSERT(cond) \
|
#define V_PRETTY_FUNCTION __FUNCSIG__
|
||||||
{ \
|
|
||||||
if (!(cond)) \
|
|
||||||
{ \
|
|
||||||
qDebug("ASSERT: %s in %s (%s:%u)", \
|
|
||||||
#cond, __FUNCSIG__, __FILE__, __LINE__); \
|
|
||||||
debug_break(); \
|
|
||||||
} \
|
|
||||||
} \
|
|
||||||
|
|
||||||
#else // GCC/Clang
|
#else // GCC/Clang
|
||||||
|
#define V_PRETTY_FUNCTION __PRETTY_FUNCTION__
|
||||||
|
#endif /*Q_CC_MSVC*/
|
||||||
|
|
||||||
#define SCASSERT(cond) \
|
#define SCASSERT(cond) \
|
||||||
{ \
|
{ \
|
||||||
if (!(cond)) \
|
if (!(cond)) \
|
||||||
{ \
|
{ \
|
||||||
qDebug("ASSERT: %s in %s (%s:%u)", \
|
qDebug("ASSERT: %s in %s (%s:%u)", \
|
||||||
#cond, __PRETTY_FUNCTION__, __FILE__, __LINE__);\
|
#cond, V_PRETTY_FUNCTION, __FILE__, __LINE__); \
|
||||||
debug_break(); \
|
debug_break(); \
|
||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
|
|
||||||
#endif /*Q_CC_MSVC*/
|
|
||||||
|
|
||||||
#else // define but disable this function if debugging is not set
|
#else // define but disable this function if debugging is not set
|
||||||
#define SCASSERT(cond) qt_noop();
|
#define SCASSERT(cond) qt_noop();
|
||||||
#endif /* V_NO_ASSERT */
|
#endif /* V_NO_ASSERT */
|
||||||
|
|
Loading…
Reference in New Issue
Block a user