OSDN Git Service

merge Q_ASSERT() and Q_ASSERT_X() definition conditionals
authorIvailo Monev <xakepa10@laimg.moc>
Tue, 14 Jul 2020 14:03:03 +0000 (14:03 +0000)
committerIvailo Monev <xakepa10@laimg.moc>
Tue, 14 Jul 2020 14:03:03 +0000 (14:03 +0000)
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
src/core/global/qglobal.h.cmake

index 974b0c4..ecd50ea 100644 (file)
@@ -629,18 +629,13 @@ Q_CORE_EXPORT void qErrnoWarning(int code, const char *msg, ...);
 Q_CORE_EXPORT void qErrnoWarning(const char *msg, ...);
 
 Q_CORE_EXPORT void qt_assert(const char *assertion, const char *file, int line);
-
-#ifndef QT_NO_DEBUG
-#  define Q_ASSERT(cond) ((!(cond)) ? qt_assert(#cond,__FILE__,__LINE__) : qt_noop())
-#else
-#  define Q_ASSERT(cond) qt_noop()
-#endif
-
 Q_CORE_EXPORT void qt_assert_x(const char *where, const char *what, const char *file, int line);
 
 #ifndef QT_NO_DEBUG
+#  define Q_ASSERT(cond) ((!(cond)) ? qt_assert(#cond,__FILE__,__LINE__) : qt_noop())
 #  define Q_ASSERT_X(cond, where, what) ((!(cond)) ? qt_assert_x(where, what,__FILE__,__LINE__) : qt_noop())
 #else
+#  define Q_ASSERT(cond) qt_noop()
 #  define Q_ASSERT_X(cond, where, what) qt_noop()
 #endif