From c6855b4489b91b1a60d1ecb18081d1697f0b63f0 Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Fri, 13 Nov 2015 11:19:24 -0500 Subject: [PATCH] Windows: Fix VS2008SP1 compiler errors (issue #1758) - override was being defined but this compiler doesn't support it. - Warning C4355 wasn't being properly suppressed in cef_resource_manager.cc --- include/base/cef_build.h | 5 ++++- include/base/cef_macros.h | 1 + libcef_dll/wrapper/cef_resource_manager.cc | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/include/base/cef_build.h b/include/base/cef_build.h index 01b08ffc2..a1a709f7a 100644 --- a/include/base/cef_build.h +++ b/include/base/cef_build.h @@ -175,7 +175,10 @@ // 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) +#if defined(__clang__) +#define OVERRIDE override +#elif defined(COMPILER_MSVC) && _MSC_VER >= 1600 +// Visual Studio 2010 and later support override. #define OVERRIDE override #elif defined(COMPILER_GCC) && __cplusplus >= 201103 && \ (__GNUC__ * 10000 + __GNUC_MINOR__ * 100) >= 40700 diff --git a/include/base/cef_macros.h b/include/base/cef_macros.h index 83f0af941..67c42e14f 100644 --- a/include/base/cef_macros.h +++ b/include/base/cef_macros.h @@ -41,6 +41,7 @@ // updated to match. #include // For size_t. +#include "include/base/cef_build.h" // For COMPILER_MSVC #if !defined(ALLOW_THIS_IN_INITIALIZER_LIST) #if defined(COMPILER_MSVC) diff --git a/libcef_dll/wrapper/cef_resource_manager.cc b/libcef_dll/wrapper/cef_resource_manager.cc index b7c5e12d6..4ef459965 100644 --- a/libcef_dll/wrapper/cef_resource_manager.cc +++ b/libcef_dll/wrapper/cef_resource_manager.cc @@ -7,6 +7,7 @@ #include #include +#include "include/base/cef_macros.h" #include "include/base/cef_weak_ptr.h" #include "include/cef_parser.h" #include "include/wrapper/cef_stream_resource_handler.h" @@ -182,7 +183,7 @@ class ArchiveProvider : public CefResourceManager::Provider { password_(password), archive_load_started_(false), archive_load_ended_(false), - weak_ptr_factory_(this) { + ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)) { DCHECK(!url_path_.empty()); DCHECK(!archive_path_.empty());