author Alastor Wu <>
Tue, 05 Mar 2019 02:06:22 +0000
changeset 516285 dc39216dfad387efd439083045062e323869a428
parent 507614 aa19f5470ee060a96cc5280d8e1f4c2e74fe6395
child 520086 51c3380d5b9456e9307f35ff09678634a7d0ee7b
permissions -rw-r--r--
Bug 1530220 - part1 : allow some non-printalble keys as supported user gesture inputs to activate document. r=masayuki,cpearce a=lizzard `carriage return` and `space` are common keys which user might use to start media, so we should take account them as supported user gesture inputs. As their pseudo char code are zero, we have to check their key code in order to distinguish them from other controls keys such as shift, alt... Differential Revision:

# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at

with Files("**"):
    BUG_COMPONENT = ("Core", "Security: PSM")




    DEFINES['NDEBUG'] = True

if CONFIG['CC_TYPE'] == 'clang-cl':
    # -Wall on clang-cl maps to -Weverything, which turns on way too
    # much, so we're passing through -Wall using -Xclang.
    CXXFLAGS += ['-Xclang']
CXXFLAGS += ['-Wall']

if CONFIG['CC_TYPE'] == 'msvc':
    # -Wall with Visual C++ enables too many problematic warnings
    CXXFLAGS += [
        '-wd4324', # structure was padded due to __declspec(align())
        '-wd4355', # 'this' used in base member initializer list
        '-wd4464', # relative include path contains '..'
        '-wd4480', # nonstandard extension used: specifying underlying type for
                   # enum 'enum'
        '-wd4481', # nonstandard extension used: override specifier 'keyword'
        '-wd4510', # default constructor could not be generated
        '-wd4512', # assignment operator could not be generated
        '-wd4514', # 'function': unreferenced inline function has been removed
        '-wd4610', # struct 'symbol' can never be instantiated - user defined
                   # constructor required
        '-wd4619', # pragma warning: there is no warning 'warning'
        '-wd4623', # default constructor could not be generated because a base
                   # class default constructor is inaccessible or deleted
        '-wd4625', # copy constructor could not be generated because a base
                   # class copy constructor is inaccessible or deleted
        '-wd4626', # assignment operator could not be generated because a base
                   # class assignment operator is inaccessible or deleted
        '-wd4640', # construction of local static object is not thread-safe
        '-wd4710', # 'function': function not inlined
        '-wd4711', # function 'function' selected for inline expansion
        '-wd4820', # 'bytes' bytes padding added after construct 'member_name'

    # Disable Spectre diagnostics only if optimization is disabled.
    if not CONFIG['MOZ_OPTIMIZE']:
        CXXFLAGS += [
            '-wd5045', # Compiler will insert Spectre mitigation for memory
                       # load if /Qspectre switch specified

    # MSVC 2010's headers trigger these
    CXXFLAGS += [
        '-wd4548', # expression before comma has no effect; ...
        '-wd4668', # 'symbol' is not defined as a preprocessor macro...
        '-wd4987', # nonstandard extension used

    # MSVC 2015 triggers these
    CXXFLAGS += [
        '-wd4456', # declaration of 'rv' hides previous local declaration
        '-wd4458', # declaration of 'input' hides class member

    # The following warnings are disabled because MSVC 2017 headers aren't
    # warning free at the -Wall level.
    CXXFLAGS += [
        '-wd4061', # enumerator 'identifier' in switch of enum 'enumeration' is
                   # not explicitly handled by a case label
        '-wd4365', # 'action' : conversion from 'type_1' to 'type_2',
                   # signed/unsigned mismatch
        '-wd4774', # '<function>' : format string expected in argument
                   # <position> is not a string literal

    # Gecko headers aren't warning-free enough for us to enable these warnings
    CXXFLAGS += [
        '-wd4100', # 'symbol' : unreferenced formal parameter
        '-wd4127', # conditional expression is constant
        '-wd4946', # reinterpret_cast used between related types

if CONFIG['CC_TYPE'] in ('clang', 'clang-cl', 'gcc'):
    CXXFLAGS += [

    # Gecko headers aren't warning-free enough for us to enable these warnings.
    CXXFLAGS += [


if CONFIG['CC_TYPE'] == 'clang-cl':
    AllowCompilerWarnings()  # workaround for bug 1090497