From 77507eff4fe61bd3160b669f0f5e282c320203d3 Mon Sep 17 00:00:00 2001 From: "andrew@webrtc.org" Date: Wed, 11 Dec 2013 00:07:11 +0000 Subject: [PATCH] Correctly define OVERRIDE 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. However, libjingle does not detect that and makes OVERRIDE a no-op. This CL updates base/common.h to define OVERRIDE 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 R=fischman@webrtc.org, wu@webrtc.org Review URL: https://webrtc-codereview.appspot.com/5159004 Patch from Chris Dumez . git-svn-id: http://webrtc.googlecode.com/svn/trunk@5255 4adac7df-926f-26a2-2b94-8c16560cd09d --- talk/base/common.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/talk/base/common.h b/talk/base/common.h index d557639e29..a76748b390 100644 --- a/talk/base/common.h +++ b/talk/base/common.h @@ -187,6 +187,10 @@ inline bool ImplicitCastToBool(bool result) { return result; } // (because it won't see this pragma). #pragma clang diagnostic ignored "-Wc++11-extensions" #define OVERRIDE override +#elif defined(__GNUC__) && __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