Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(631)

Unified Diff: base/compiler_specific.h

Issue 107113002: Correctly define OVERRIDE / FINAL when building with g++ 4.7 and C++11 support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/compiler_specific.h
diff --git a/base/compiler_specific.h b/base/compiler_specific.h
index 409a613964cef2cf74c36ade8b040e5e63656757..dc4b23349873c8ae81e0312badd109bf2416f222 100644
--- a/base/compiler_specific.h
+++ b/base/compiler_specific.h
@@ -141,6 +141,10 @@
#define OVERRIDE override
#elif defined(__clang__)
#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
@@ -155,6 +159,10 @@
#define FINAL sealed
#elif defined(__clang__)
#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
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698