diff options
author | ch.dumez@samsung.com <ch.dumez@samsung.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-06 14:16:22 +0000 |
---|---|---|
committer | ch.dumez@samsung.com <ch.dumez@samsung.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-06 14:16:22 +0000 |
commit | 9d6985f61e708f70475b213fb0269627a95d77c1 (patch) | |
tree | 946a2debe5fb055b1fe92b9e3a29266aab87324b /base | |
parent | e90d0f33395631f63688e795494ebb647ce06dc2 (diff) | |
download | chromium_src-9d6985f61e708f70475b213fb0269627a95d77c1.zip chromium_src-9d6985f61e708f70475b213fb0269627a95d77c1.tar.gz chromium_src-9d6985f61e708f70475b213fb0269627a95d77c1.tar.bz2 |
Correctly define OVERRIDE / FINAL when building with g++ 4.7 and C++11 support
g++ 4.7 and later support explicit virtual overrides when building with C++11 support
enabled. Blink correctly detects that and defines OVERRIDE / FINAL properly. However,
Chrome does not detect compiler support properly and makes OVERRIDE / FINAL no-ops.
This causes the compiler to complain about OVERRIDE / FINAL being redefined.
This CL updates base/compiler_specific.h to define OVERRIDE / FINAL properly when
g++ 4.7 is used with C++11 support enabled.
See this page for GCC support of C++11 features:
http://gcc.gnu.org/projects/cxx0x.html
BUG=233330
Review URL: https://codereview.chromium.org/107113002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239207 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r-- | base/compiler_specific.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/base/compiler_specific.h b/base/compiler_specific.h index 409a613..dc4b233 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 |