- Change ALLOW_UNUSED to ALLOW_UNUSED_TYPE and ALLOW_UNUSED_LOCAL to match Chromium.

- Windows: d3dcompiler_46.dll changed to d3dcompiler_47.dll due to 8.1 SDK update (issue #1484).
- Windows: Fix `local variable is initialized but not referenced` warning with Release build (issue #1484).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1962 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt 2015-01-08 02:42:59 +00:00
parent 7fe86e0b26
commit b5e8914bde
8 changed files with 27 additions and 22 deletions

View File

@ -437,7 +437,7 @@ if(OS_WINDOWS)
# List of CEF binary files.
set(CEF_BINARY_FILES
d3dcompiler_43.dll
d3dcompiler_46.dll
d3dcompiler_47.dll
ffmpegsumo.dll
libcef.dll
libEGL.dll

View File

@ -160,18 +160,26 @@
#endif
#endif // WARN_UNUSED_RESULT
// Annotate a typedef or function indicating it's ok if it's not used.
// Use like:
// typedef Foo Bar ALLOW_UNUSED_TYPE;
#ifndef ALLOW_UNUSED_TYPE
#if defined(COMPILER_GCC)
#define ALLOW_UNUSED_TYPE __attribute__((unused))
#else
#define ALLOW_UNUSED_TYPE
#endif
#endif // ALLOW_UNUSED_TYPE
// 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.)
// Use like:
// int x ALLOW_UNUSED = ...;
#ifndef ALLOW_UNUSED
#if defined(COMPILER_GCC)
#define ALLOW_UNUSED __attribute__((unused))
#else
#define ALLOW_UNUSED
// int x = ...;
// ALLOW_UNUSED_LOCAL(x);
#ifndef ALLOW_UNUSED_LOCAL
#define ALLOW_UNUSED_LOCAL(x) false ? (void)x : (void)0
#endif
#endif // ALLOW_UNUSED
#endif // !BUILDING_CEF_SHARED

View File

@ -165,7 +165,8 @@ struct CompileAssert {
} // namespace cef
#define COMPILE_ASSERT(expr, msg) \
typedef cef::CompileAssert<(bool(expr))> msg[bool(expr) ? 1 : -1] ALLOW_UNUSED
typedef cef::CompileAssert<(bool(expr))> msg[bool(expr) ? 1 : -1] \
ALLOW_UNUSED_TYPE
// Implementation details of COMPILE_ASSERT:
//

View File

@ -6,15 +6,11 @@
#include "libcef/browser/browser_host_impl.h"
#include "libcef/browser/window_x11.h"
#include "base/compiler_specific.h"
#include "base/strings/string_util.h"
#include "ui/aura/window.h"
#include "ui/gfx/point.h"
// Used to silence warnings about unused variables.
#if !defined(UNUSED)
#define UNUSED(x) ((void)(x))
#endif
CefMenuCreatorRunnerLinux::CefMenuCreatorRunnerLinux() {
}
@ -59,7 +55,7 @@ bool CefMenuCreatorRunnerLinux::RunContextMenu(CefMenuCreator* manager) {
NULL, gfx::Rect(screen_point, gfx::Size()),
views::MENU_ANCHOR_TOPRIGHT,
ui::MENU_SOURCE_NONE);
UNUSED(result);
ALLOW_UNUSED_LOCAL(result);
return true;
}

View File

@ -10,12 +10,9 @@
#include "libcef/browser/browser_host_impl.h"
#include "libcef/browser/text_input_client_osr_mac.h"
#include "base/compiler_specific.h"
#include "ui/events/latency_info.h"
#if !defined(UNUSED)
#define UNUSED(x) ((void)(x)) /* to avoid warnings */
#endif
namespace {
CefTextInputClientOSRMac* GetInputClientFromContext(
@ -310,7 +307,7 @@ void CefRenderWidgetHostViewOSR::PlatformDestroyCompositorWidget() {
// Compositor is owned by and will be freed by BrowserCompositorMac.
ui::Compositor* compositor = compositor_.release();
UNUSED(compositor);
ALLOW_UNUSED_LOCAL(compositor);
[window_ close];
window_ = nil;

View File

@ -7,6 +7,7 @@
#include <windowsx.h>
#include "include/base/cef_bind.h"
#include "include/base/cef_build.h"
#include "include/wrapper/cef_closure_task.h"
#include "cefclient/resource.h"
@ -18,6 +19,7 @@ class ScopedGLContext {
: hdc_(hdc),
swap_buffers_(swap_buffers) {
BOOL result = wglMakeCurrent(hdc, hglrc);
ALLOW_UNUSED_LOCAL(result);
DCHECK(result);
}
~ScopedGLContext() {
@ -352,6 +354,7 @@ void OSRWindow::DisableGL() {
if (IsWindow(hWnd_)) {
// wglDeleteContext will make the context not current before deleting it.
BOOL result = wglDeleteContext(hRC_);
ALLOW_UNUSED_LOCAL(result);
DCHECK(result);
ReleaseDC(hWnd_, hDC_);
}

View File

@ -44,7 +44,7 @@ Optional components:
* Angle and Direct3D support
d3dcompiler_43.dll (required for Windows XP)
d3dcompiler_46.dll (required for Windows Vista and newer)
d3dcompiler_47.dll (required for Windows Vista and newer)
libEGL.dll
libGLESv2.dll
Note: Without these components HTML5 accelerated content like 2D canvas, 3D

View File

@ -418,7 +418,7 @@ if mode == 'standard':
if platform == 'windows':
binaries = [
'd3dcompiler_46.dll',
'd3dcompiler_47.dll',
'ffmpegsumo.dll',
'libcef.dll',
'libEGL.dll',