Fix compile errors with VS2019 v16.9.3 and GCC v7.5.0 (see issue #3140)

This commit is contained in:
Marshall Greenblatt 2021-06-20 12:08:10 -04:00
parent 529b91bc6e
commit 9efd3dc8ee
14 changed files with 39 additions and 3 deletions

View File

@ -407,6 +407,7 @@ if(OS_WINDOWS)
/wd4100 # Ignore "unreferenced formal parameter" warning
/wd4127 # Ignore "conditional expression is constant" warning
/wd4244 # Ignore "conversion possible loss of data" warning
/wd4324 # Ignore "structure was padded due to alignment specifier" warning
/wd4481 # Ignore "nonstandard extension used: override" warning
/wd4512 # Ignore "assignment operator could not be generated" warning
/wd4701 # Ignore "potentially uninitialized local variable" warning

View File

@ -67,6 +67,15 @@
#define HAS_BUILTIN(x) 0
#endif
// __has_feature and __has_attribute don't exist for MSVC.
#if !defined(__has_feature)
#define __has_feature(x) 0
#endif // !defined(__has_feature)
#if !defined(__has_attribute)
#define __has_attribute(x) 0
#endif // !defined(__has_attribute)
// Annotate a variable indicating it's ok if the variable is not used.
// (Typically used to silence a compiler warning when the assignment
// is important for some other reason.)

View File

@ -21,6 +21,7 @@ bool QueryCancellationTraitsForNonCancellables(
return true;
}
NOTREACHED();
return false;
}
} // namespace

View File

@ -210,7 +210,7 @@ std::string SystemErrorCodeToString(SystemErrorCode error_code) {
char msgbuf[error_message_buffer_size];
DWORD flags = FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS;
DWORD len = FormatMessageA(flags, NULL, error_code, 0, msgbuf,
base::size(msgbuf), NULL);
static_cast<DWORD>(base::size(msgbuf)), NULL);
std::stringstream ss;
if (len) {
std::string s(msgbuf);

View File

@ -41,13 +41,24 @@ void cef_sandbox_info_destroy(void* sandbox_info) {
}
#if BUILDFLAG(IS_CEF_SANDBOX_BUILD)
// Implementation from third_party/abseil-cpp/absl/types/bad_variant_access.cc
// to avoid bringing in absl dependencies.
// Avoid bringing in absl dependencies.
namespace absl {
// From third_party/abseil-cpp/absl/types/bad_optional_access.cc
namespace optional_internal {
void throw_bad_optional_access() {
LOG(FATAL) << "Bad optional access";
abort();
}
} // namespace optional_internal
// From third_party/abseil-cpp/absl/types/bad_variant_access.cc
namespace variant_internal {
void ThrowBadVariantAccess() {
LOG(FATAL) << "Bad variant access";
abort();
}
} // namespace variant_internal
} // namespace absl
#endif // BUILDFLAG(IS_CEF_SANDBOX_BUILD)

View File

@ -16,6 +16,8 @@
#include <X11/Xcursor/Xcursor.h>
#include <X11/keysym.h>
#include <algorithm>
#include "include/base/cef_cxx17_backports.h"
#include "include/base/cef_logging.h"
#include "include/base/cef_macros.h"

View File

@ -4,6 +4,8 @@
#include "tests/cefclient/browser/image_cache.h"
#include <algorithm>
#include "tests/shared/browser/file_util.h"
#include "tests/shared/browser/resource_util.h"

View File

@ -4,6 +4,8 @@
#include "tests/cefclient/browser/main_context_impl.h"
#include <algorithm>
#include "include/cef_parser.h"
#include "include/cef_web_plugin.h"
#include "tests/shared/browser/client_app_browser.h"

View File

@ -4,6 +4,7 @@
#include "tests/cefclient/browser/test_runner.h"
#include <algorithm>
#include <map>
#include <set>
#include <sstream>

View File

@ -2,6 +2,7 @@
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
#include <algorithm>
#include <vector>
#include "include/base/cef_callback.h"

View File

@ -2,6 +2,7 @@
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
#include <algorithm>
#include <memory>
#include "include/base/cef_callback.h"

View File

@ -3,6 +3,9 @@
// can be found in the LICENSE file.
#include "tests/ceftests/test_util.h"
#include <algorithm>
#include "include/cef_command_line.h"
#include "include/cef_request_context_handler.h"
#include "tests/gtest/include/gtest/gtest.h"

View File

@ -2,6 +2,7 @@
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
#include <algorithm>
#include <memory>
#include "include/base/cef_callback.h"

View File

@ -4,6 +4,7 @@
#include "tests/shared/browser/extension_util.h"
#include <algorithm>
#include <memory>
#include "include/base/cef_callback.h"