summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authorkevers <kevers@chromium.org>2014-09-15 07:33:09 -0700
committerCommit bot <commit-bot@chromium.org>2014-09-15 15:02:22 +0000
commit908d52405f9961fd87d3b65287ab50f67a1d7c1b (patch)
tree1a83d34e59d3bc315774474f0de381d9898fb3c9 /base
parent8616ac4cf7bd77f53dc001eb9d8d61c6c975eaaa (diff)
downloadchromium_src-908d52405f9961fd87d3b65287ab50f67a1d7c1b.zip
chromium_src-908d52405f9961fd87d3b65287ab50f67a1d7c1b.tar.gz
chromium_src-908d52405f9961fd87d3b65287ab50f67a1d7c1b.tar.bz2
Revert of Use a C++11 feature in a single file, to discover if this works everywhere. (patchset #5 id:70001 of https://codereview.chromium.org/443483002/)
Reason for revert: Breaks Arm compile of Chrome on ChromeOS. http://build.chromium.org/p/chromiumos.chromium/builders/Daisy%20%28chromium%29/builds/1732 chromeos-chrome-39.0.2157.0_alpha-r1: In file included from threading/watchdog.cc:5:0: chromeos-chrome-39.0.2157.0_alpha-r1: ../base/threading/watchdog.h:68:29: error: override controls (override/final) only available with -std=c++11 or -std=gnu++11 [-Werror] chromeos-chrome-39.0.2157.0_alpha-r1: virtual void ThreadMain() OVERRIDE; Original issue's description: > Use a C++11 feature in a single file, to discover if this works everywhere. > > Similar to https://codereview.chromium.org/385743002 , but in a file > that's also built in host targets. Depends on r#294584. > > If your bot can't deal with this, please let me know! > > BUG=none > > Committed: https://crrev.com/5928c2f978a43488a2f45fe7da1d91dfdba1d593 > Cr-Commit-Position: refs/heads/master@{#294687} TBR=ajwong@chromium.org,thakis@chromium.org NOTREECHECKS=true NOTRY=true BUG=none Review URL: https://codereview.chromium.org/570083002 Cr-Commit-Position: refs/heads/master@{#294822}
Diffstat (limited to 'base')
-rw-r--r--base/compiler_specific.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/base/compiler_specific.h b/base/compiler_specific.h
index a93d350..9e2111d 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: