From c11cb16f3f4249347ea3db4e1586bc1dac3a7d39 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sun, 8 Jan 2012 19:58:43 +0100 Subject: [PATCH] Add defines for explicit virtual overrides. Change-Id: Ia9a610e81eeaaa0a08ca6ef4945b002bdb13fe8a Reviewed-by: Thiago Macieira Reviewed-by: Lars Knoll --- src/corelib/global/qglobal.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 5e743b287d..1d924e840d 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -520,6 +520,11 @@ namespace QT_NAMESPACE {} # define Q_COMPILER_UNRESTRICTED_UNIONS # define Q_COMPILER_RANGE_FOR # endif +# if (__GNUC__ * 100 + __GNUC_MINOR__) >= 407 + /* C++0x features supported in GCC 4.7: */ +# define Q_COMPILER_EXPLICIT_OVERRIDES +# define Q_COMPILER_FINAL +# endif # endif @@ -1083,6 +1088,18 @@ redefine to built-in booleans to make autotests work properly */ # define Q_DECL_CONSTEXPR #endif +#ifdef Q_COMPILER_EXPLICIT_OVERRIDES +# define Q_DECL_OVERRIDE override +#else +# define Q_DECL_OVERRIDE +#endif + +#ifdef Q_COMPILER_FINAL +# define Q_DECL_FINAL final +#else +# define Q_DECL_FINAL +#endif + //defines the type for the WNDPROC on windows //the alignment needs to be forced for sse2 to not crash with mingw #if defined(Q_OS_WIN)