Add defines for explicit virtual overrides.
authorStephen Kelly <stephen.kelly@kdab.com>
Sun, 8 Jan 2012 18:58:43 +0000 (19:58 +0100)
committerQt by Nokia <qt-info@nokia.com>
Tue, 10 Jan 2012 15:11:50 +0000 (16:11 +0100)
Change-Id: Ia9a610e81eeaaa0a08ca6ef4945b002bdb13fe8a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
src/corelib/global/qglobal.h

index 5e743b2..1d924e8 100644 (file)
@@ -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)