From e9770b468474dbb1e2774d76b5309d729f35f4b8 Mon Sep 17 00:00:00 2001 From: Pierre Rossi Date: Thu, 28 Jul 2011 11:04:07 +0200 Subject: Introducing ASSERT_NOT_REACHED In a similar fashion as WebKit, this might make those cases where we don't expect to go more obvious in debug builds. I also took the liberty to revisit a lot of switch statements but it could potentially be used elsewhere Reviewed-by: andrea --- src/rekonq_defines.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/rekonq_defines.h') diff --git a/src/rekonq_defines.h b/src/rekonq_defines.h index fd0d1e25..bd11c24e 100644 --- a/src/rekonq_defines.h +++ b/src/rekonq_defines.h @@ -51,7 +51,13 @@ #define QL1S(x) QLatin1String(x) #define QL1C(x) QLatin1Char(x) - +#ifndef ASSERT_NOT_REACHED +# ifndef QT_NO_DEBUG +# define ASSERT_NOT_REACHED(msg) qt_assert(#msg,__FILE__,__LINE__); kDebug() << #msg +# else +# define ASSERT_NOT_REACHED(msg) kDebug() << #msg +# endif +#endif //ASSERT_NOT_REACHED // ---------------------------------------------------------------------------------------------------- // ENUMS -- cgit v1.2.1