mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-01-23 16:01:08 +01:00
Add missing OVERRIDE specifier to avoid compile errors with clang 3.6 (issue #1688)
This commit is contained in:
parent
aef9fd486a
commit
614e2a5b7e
@ -132,22 +132,6 @@
|
||||
#error Please add support for your compiler in cef_build.h
|
||||
#endif
|
||||
|
||||
// Annotate a virtual method indicating it must be overriding a virtual
|
||||
// method in the parent class.
|
||||
// Use like:
|
||||
// virtual void foo() OVERRIDE;
|
||||
#ifndef 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
|
||||
#endif // OVERRIDE
|
||||
|
||||
// Annotate a function indicating the caller must examine the return value.
|
||||
// Use like:
|
||||
// int foo() WARN_UNUSED_RESULT;
|
||||
@ -183,4 +167,23 @@
|
||||
|
||||
#endif // !BUILDING_CEF_SHARED
|
||||
|
||||
// Annotate a virtual method indicating it must be overriding a virtual method
|
||||
// in the parent class.
|
||||
// Use like:
|
||||
// void foo() OVERRIDE;
|
||||
// NOTE: This define should only be used in classes exposed to the client since
|
||||
// C++11 support may not be enabled in client applications. CEF internal classes
|
||||
// should use the `override` keyword directly.
|
||||
#ifndef 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
|
||||
#endif // OVERRIDE
|
||||
|
||||
#endif // CEF_INCLUDE_BASE_CEF_BUILD_H_
|
||||
|
@ -113,17 +113,17 @@ class CefRefCount {
|
||||
///
|
||||
#define IMPLEMENT_REFCOUNTING(ClassName) \
|
||||
public: \
|
||||
void AddRef() const { \
|
||||
void AddRef() const OVERRIDE { \
|
||||
ref_count_.AddRef(); \
|
||||
} \
|
||||
bool Release() const { \
|
||||
bool Release() const OVERRIDE { \
|
||||
if (ref_count_.Release()) { \
|
||||
delete static_cast<const ClassName*>(this); \
|
||||
return true; \
|
||||
} \
|
||||
return false; \
|
||||
} \
|
||||
bool HasOneRef() const { \
|
||||
bool HasOneRef() const OVERRIDE { \
|
||||
return ref_count_.HasOneRef(); \
|
||||
} \
|
||||
private: \
|
||||
|
@ -148,7 +148,7 @@ class CefRunnableMethod : public CefTask {
|
||||
traits_.ReleaseCallee(obj);
|
||||
}
|
||||
|
||||
virtual void Execute() {
|
||||
void Execute() OVERRIDE {
|
||||
if (obj_)
|
||||
DispatchToMethod(obj_, meth_, params_);
|
||||
}
|
||||
@ -240,7 +240,7 @@ class CefRunnableFunction : public CefTask {
|
||||
~CefRunnableFunction() {
|
||||
}
|
||||
|
||||
virtual void Execute() {
|
||||
void Execute() OVERRIDE {
|
||||
if (function_)
|
||||
DispatchToFunction(function_, params_);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user