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

Unified Diff: src/globals.h

Issue 23098004: Add FINAL and OVERRIDE macros for C++11 final/override. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 4 months 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 | « src/ast.h ('k') | src/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/globals.h
diff --git a/src/globals.h b/src/globals.h
index 26fd53114c62d582501e5d37c2c7791cb60cd99b..7848c50ce503492948b8e573726f441b4a435132 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -375,6 +375,29 @@ F FUNCTION_CAST(Address addr) {
#endif
+// Annotate a virtual method indicating it must be overriding a virtual
+// method in the parent class.
+// Use like:
+// virtual void bar() OVERRIDE;
+#if __cplusplus >= 201103L
Sven Panne 2013/08/19 12:44:48 Looking at Chrome's base/compiler_specific.h, I th
+#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:
+// class B FINAL : public A {};
+// virtual void bar() FINAL;
+#if __cplusplus >= 201103L
Sven Panne 2013/08/19 12:44:48 Same here: For MSVC we can fall back to 'sealed',
+#define FINAL final
+#else
+#define FINAL
+#endif
+
+
#if defined(__GNUC__) && __GNUC__ >= 4
#define MUST_USE_RESULT __attribute__ ((warn_unused_result))
#else
« no previous file with comments | « src/ast.h ('k') | src/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698