mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Add missing OVERRIDE specifier to avoid compile errors with clang 3.6 (issue #1688)
This commit is contained in:
@ -132,22 +132,6 @@
|
|||||||
#error Please add support for your compiler in cef_build.h
|
#error Please add support for your compiler in cef_build.h
|
||||||
#endif
|
#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.
|
// Annotate a function indicating the caller must examine the return value.
|
||||||
// Use like:
|
// Use like:
|
||||||
// int foo() WARN_UNUSED_RESULT;
|
// int foo() WARN_UNUSED_RESULT;
|
||||||
@ -183,4 +167,23 @@
|
|||||||
|
|
||||||
#endif // !BUILDING_CEF_SHARED
|
#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_
|
#endif // CEF_INCLUDE_BASE_CEF_BUILD_H_
|
||||||
|
@ -113,17 +113,17 @@ class CefRefCount {
|
|||||||
///
|
///
|
||||||
#define IMPLEMENT_REFCOUNTING(ClassName) \
|
#define IMPLEMENT_REFCOUNTING(ClassName) \
|
||||||
public: \
|
public: \
|
||||||
void AddRef() const { \
|
void AddRef() const OVERRIDE { \
|
||||||
ref_count_.AddRef(); \
|
ref_count_.AddRef(); \
|
||||||
} \
|
} \
|
||||||
bool Release() const { \
|
bool Release() const OVERRIDE { \
|
||||||
if (ref_count_.Release()) { \
|
if (ref_count_.Release()) { \
|
||||||
delete static_cast<const ClassName*>(this); \
|
delete static_cast<const ClassName*>(this); \
|
||||||
return true; \
|
return true; \
|
||||||
} \
|
} \
|
||||||
return false; \
|
return false; \
|
||||||
} \
|
} \
|
||||||
bool HasOneRef() const { \
|
bool HasOneRef() const OVERRIDE { \
|
||||||
return ref_count_.HasOneRef(); \
|
return ref_count_.HasOneRef(); \
|
||||||
} \
|
} \
|
||||||
private: \
|
private: \
|
||||||
|
@ -148,7 +148,7 @@ class CefRunnableMethod : public CefTask {
|
|||||||
traits_.ReleaseCallee(obj);
|
traits_.ReleaseCallee(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void Execute() {
|
void Execute() OVERRIDE {
|
||||||
if (obj_)
|
if (obj_)
|
||||||
DispatchToMethod(obj_, meth_, params_);
|
DispatchToMethod(obj_, meth_, params_);
|
||||||
}
|
}
|
||||||
@ -240,7 +240,7 @@ class CefRunnableFunction : public CefTask {
|
|||||||
~CefRunnableFunction() {
|
~CefRunnableFunction() {
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void Execute() {
|
void Execute() OVERRIDE {
|
||||||
if (function_)
|
if (function_)
|
||||||
DispatchToFunction(function_, params_);
|
DispatchToFunction(function_, params_);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user