Index: base/compiler_specific.h |
diff --git a/base/compiler_specific.h b/base/compiler_specific.h |
index a93d350aae0999964bf29c30b58469a728aa2ac9..9e2111db6b6e1aea9aa59beb96047c3c3ef2c3eb 100644 |
--- a/base/compiler_specific.h |
+++ b/base/compiler_specific.h |
@@ -137,14 +137,30 @@ |
// method in the parent class. |
// Use like: |
// virtual void foo() OVERRIDE; |
+#if defined(__clang__) || defined(COMPILER_MSVC) |
#define OVERRIDE override |
+#elif defined(COMPILER_GCC) && __cplusplus >= 201103 && \ |
+ (__GNUC__ * 10000 + __GNUC_MINOR__ * 100) >= 40700 |
+// GCC 4.7 supports explicit virtual overrides when C++11 support is enabled. |
+#define OVERRIDE override |
+#else |
+#define OVERRIDE |
+#endif |
// Annotate a virtual method indicating that subclasses must not override it, |
// or annotate a class to indicate that it cannot be subclassed. |
// Use like: |
// virtual void foo() FINAL; |
// class B FINAL : public A {}; |
+#if defined(__clang__) || defined(COMPILER_MSVC) |
#define FINAL final |
+#elif defined(COMPILER_GCC) && __cplusplus >= 201103 && \ |
+ (__GNUC__ * 10000 + __GNUC_MINOR__ * 100) >= 40700 |
+// GCC 4.7 supports explicit virtual overrides when C++11 support is enabled. |
+#define FINAL final |
+#else |
+#define FINAL |
+#endif |
// Annotate a function indicating the caller must examine the return value. |
// Use like: |