gfx/skia/patches/0023-Bug-890539-Fix-SK_COMPILE_ASSERT-build-warning.patch

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

michael@0 1 # HG changeset patch
michael@0 2 # Parent e378875000890099fffcdb4cbc4ab12828ac34ee
michael@0 3 # User Daniel Holbert <dholbert@cs.stanford.edu>
michael@0 4 Bug 890539: Annotate SK_COMPILE_ASSERT's typedef as permissibly unused, to fix GCC 4.8 build warning. r=gw280
michael@0 5
michael@0 6 diff --git a/gfx/skia/include/core/SkTypes.h b/gfx/skia/include/core/SkTypes.h
michael@0 7 --- a/gfx/skia/include/core/SkTypes.h
michael@0 8 +++ b/gfx/skia/include/core/SkTypes.h
michael@0 9 @@ -121,18 +121,29 @@ inline void operator delete(void* p) {
michael@0 10 #define SkDEVCODE(code)
michael@0 11 #define SK_DEVELOPER_TO_STRING()
michael@0 12 #endif
michael@0 13
michael@0 14 template <bool>
michael@0 15 struct SkCompileAssert {
michael@0 16 };
michael@0 17
michael@0 18 +/*
michael@0 19 + * The SK_COMPILE_ASSERT definition creates an otherwise-unused typedef. This
michael@0 20 + * triggers compiler warnings with some versions of gcc, so mark the typedef
michael@0 21 + * as permissibly-unused to disable the warnings.
michael@0 22 + */
michael@0 23 +# if defined(__GNUC__)
michael@0 24 +# define SK_COMPILE_ASSERT_UNUSED_ATTRIBUTE __attribute__((unused))
michael@0 25 +# else
michael@0 26 +# define SK_COMPILE_ASSERT_UNUSED_ATTRIBUTE /* nothing */
michael@0 27 +# endif
michael@0 28 +
michael@0 29 #define SK_COMPILE_ASSERT(expr, msg) \
michael@0 30 - typedef SkCompileAssert<(bool(expr))> msg[bool(expr) ? 1 : -1]
michael@0 31 + typedef SkCompileAssert<(bool(expr))> msg[bool(expr) ? 1 : -1] SK_COMPILE_ASSERT_UNUSED_ATTRIBUTE
michael@0 32
michael@0 33 /*
michael@0 34 * Usage: SK_MACRO_CONCAT(a, b) to construct the symbol ab
michael@0 35 *
michael@0 36 * SK_MACRO_CONCAT_IMPL_PRIV just exists to make this work. Do not use directly
michael@0 37 *
michael@0 38 */
michael@0 39 #define SK_MACRO_CONCAT(X, Y) SK_MACRO_CONCAT_IMPL_PRIV(X, Y)

mercurial