From 762fcdcca91860b4e69b6d4430851cc5e8197521 Mon Sep 17 00:00:00 2001 From: "andrew@webrtc.org" Date: Tue, 10 Dec 2013 19:20:46 +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, webrtc does not detect that and makes OVERRIDE a no-op. This CL updates typedefs.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=andrew@webrtc.org, fischman@webrtc.org Review URL: https://webrtc-codereview.appspot.com/5149005 Patch from Chris Dumez . git-svn-id: http://webrtc.googlecode.com/svn/trunk@5253 4adac7df-926f-26a2-2b94-8c16560cd09d --- webrtc/typedefs.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/webrtc/typedefs.h b/webrtc/typedefs.h index 35ccde488d..472c74b088 100644 --- a/webrtc/typedefs.h +++ b/webrtc/typedefs.h @@ -88,6 +88,10 @@ typedef unsigned __int64 uint64_t; // (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