diff --git a/cmake/cef_variables.cmake.in b/cmake/cef_variables.cmake.in index 348654525..ce73e1678 100644 --- a/cmake/cef_variables.cmake.in +++ b/cmake/cef_variables.cmake.in @@ -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 diff --git a/include/base/cef_compiler_specific.h b/include/base/cef_compiler_specific.h index 379299577..812e93b52 100644 --- a/include/base/cef_compiler_specific.h +++ b/include/base/cef_compiler_specific.h @@ -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.) diff --git a/libcef_dll/base/cef_callback_internal.cc b/libcef_dll/base/cef_callback_internal.cc index b5a4b1497..6a381b152 100644 --- a/libcef_dll/base/cef_callback_internal.cc +++ b/libcef_dll/base/cef_callback_internal.cc @@ -21,6 +21,7 @@ bool QueryCancellationTraitsForNonCancellables( return true; } NOTREACHED(); + return false; } } // namespace diff --git a/libcef_dll/base/cef_logging.cc b/libcef_dll/base/cef_logging.cc index 8f9016858..715cf17e6 100644 --- a/libcef_dll/base/cef_logging.cc +++ b/libcef_dll/base/cef_logging.cc @@ -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(base::size(msgbuf)), NULL); std::stringstream ss; if (len) { std::string s(msgbuf); diff --git a/libcef_dll/sandbox/sandbox_win.cc b/libcef_dll/sandbox/sandbox_win.cc index bf857f51f..c13297074 100644 --- a/libcef_dll/sandbox/sandbox_win.cc +++ b/libcef_dll/sandbox/sandbox_win.cc @@ -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) diff --git a/tests/cefclient/browser/browser_window_osr_gtk.cc b/tests/cefclient/browser/browser_window_osr_gtk.cc index 4b955f99a..7e5c52f13 100644 --- a/tests/cefclient/browser/browser_window_osr_gtk.cc +++ b/tests/cefclient/browser/browser_window_osr_gtk.cc @@ -16,6 +16,8 @@ #include #include +#include + #include "include/base/cef_cxx17_backports.h" #include "include/base/cef_logging.h" #include "include/base/cef_macros.h" diff --git a/tests/cefclient/browser/image_cache.cc b/tests/cefclient/browser/image_cache.cc index c72003cd4..ea0ee5516 100644 --- a/tests/cefclient/browser/image_cache.cc +++ b/tests/cefclient/browser/image_cache.cc @@ -4,6 +4,8 @@ #include "tests/cefclient/browser/image_cache.h" +#include + #include "tests/shared/browser/file_util.h" #include "tests/shared/browser/resource_util.h" diff --git a/tests/cefclient/browser/main_context_impl.cc b/tests/cefclient/browser/main_context_impl.cc index 21ffeae08..5452acb2a 100644 --- a/tests/cefclient/browser/main_context_impl.cc +++ b/tests/cefclient/browser/main_context_impl.cc @@ -4,6 +4,8 @@ #include "tests/cefclient/browser/main_context_impl.h" +#include + #include "include/cef_parser.h" #include "include/cef_web_plugin.h" #include "tests/shared/browser/client_app_browser.h" diff --git a/tests/cefclient/browser/test_runner.cc b/tests/cefclient/browser/test_runner.cc index a1ed39d2e..30e1bdbd6 100644 --- a/tests/cefclient/browser/test_runner.cc +++ b/tests/cefclient/browser/test_runner.cc @@ -4,6 +4,7 @@ #include "tests/cefclient/browser/test_runner.h" +#include #include #include #include diff --git a/tests/ceftests/cookie_unittest.cc b/tests/ceftests/cookie_unittest.cc index ea33bbbfd..4a930faa0 100644 --- a/tests/ceftests/cookie_unittest.cc +++ b/tests/ceftests/cookie_unittest.cc @@ -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 #include #include "include/base/cef_callback.h" diff --git a/tests/ceftests/download_unittest.cc b/tests/ceftests/download_unittest.cc index 6470311b0..525519d8e 100644 --- a/tests/ceftests/download_unittest.cc +++ b/tests/ceftests/download_unittest.cc @@ -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 #include #include "include/base/cef_callback.h" diff --git a/tests/ceftests/test_util.cc b/tests/ceftests/test_util.cc index a636c15e0..f8ea0995e 100644 --- a/tests/ceftests/test_util.cc +++ b/tests/ceftests/test_util.cc @@ -3,6 +3,9 @@ // can be found in the LICENSE file. #include "tests/ceftests/test_util.h" + +#include + #include "include/cef_command_line.h" #include "include/cef_request_context_handler.h" #include "tests/gtest/include/gtest/gtest.h" diff --git a/tests/ceftests/webui_unittest.cc b/tests/ceftests/webui_unittest.cc index aca2f1365..06a605484 100644 --- a/tests/ceftests/webui_unittest.cc +++ b/tests/ceftests/webui_unittest.cc @@ -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 #include #include "include/base/cef_callback.h" diff --git a/tests/shared/browser/extension_util.cc b/tests/shared/browser/extension_util.cc index 7b774b866..6163040e6 100644 --- a/tests/shared/browser/extension_util.cc +++ b/tests/shared/browser/extension_util.cc @@ -4,6 +4,7 @@ #include "tests/shared/browser/extension_util.h" +#include #include #include "include/base/cef_callback.h"