From 6a25a86d375b03805686e82dbe9e9974f92bf5dd Mon Sep 17 00:00:00 2001 From: Harald Fernengel Date: Fri, 11 Nov 2011 11:21:52 +0100 Subject: Add a -force-asserts option to configure We have the following scenario: Either you build a release package without asserts, or a debug package with asserts. However, in embedded development, we need asserts also in release packages. This flag allows you to build a release package, but Q_ASSERTs still fire. Change-Id: Icd1dd4dd63c3cafecf515b40741263d902ad42d1 Reviewed-by: Joerg Bornemann Reviewed-by: Thiago Macieira --- src/corelib/global/qglobal.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/corelib/global/qglobal.h') diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 2b44d708ea..714e120db6 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -1706,10 +1706,10 @@ inline QNoDebug qDebug(); Q_CORE_EXPORT void qt_assert(const char *assertion, const char *file, int line); #if !defined(Q_ASSERT) -# ifndef QT_NO_DEBUG -# define Q_ASSERT(cond) ((!(cond)) ? qt_assert(#cond,__FILE__,__LINE__) : qt_noop()) -# else +# if defined(QT_NO_DEBUG) && !defined(QT_FORCE_ASSERTS) # define Q_ASSERT(cond) qt_noop() +# else +# define Q_ASSERT(cond) ((!(cond)) ? qt_assert(#cond,__FILE__,__LINE__) : qt_noop()) # endif #endif -- cgit v1.2.3