Commit 7c0169de authored by Mirko Bonadei's avatar Mirko Bonadei Committed by Chromium LUCI CQ

Enable usrsctp runtime checks.

The usrsctp library has a mechanism to enforce invariants (similar to
CHECK or RTC_CHECK). In order to enable these checks, the macro
INVARIANTS needs to be defined on all the usrsctp translation units.

Maybe, this macro should be renamed into USRSCTP_ENABLE_CHECKS or at
least into something with USRSCTP_ as prefix.

This CL enables these runtime checks in debug builds and when the
build is explicitly asking for them (dcheck_always_on=true).

Bug: None
Change-Id: Id63d78200ae2a762b86a4dc0c70d1a04e7d94350
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2600903Reviewed-by: default avatarHarald Alvestrand <hta@chromium.org>
Commit-Queue: Mirko Bonadei <mbonadei@chromium.org>
Cr-Commit-Position: refs/heads/master@{#840138}
parent 3f836c88
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
import("//build/config/dcheck_always_on.gni")
import("//build/toolchain/toolchain.gni") import("//build/toolchain/toolchain.gni")
config("usrsctp_config") { config("usrsctp_config") {
...@@ -10,10 +11,18 @@ config("usrsctp_config") { ...@@ -10,10 +11,18 @@ config("usrsctp_config") {
"usrsctplib/usrsctplib/netinet", "usrsctplib/usrsctplib/netinet",
] ]
defines = []
if (is_debug || dcheck_always_on) {
defines += [
"INVARIANTS", # Enable runtime checks.
]
}
# This is part of the public config because it's used both by usrsctp and # This is part of the public config because it's used both by usrsctp and
# the client (WebRTC), to determine if the length field needs populating. # the client (WebRTC), to determine if the length field needs populating.
if (is_mac || is_ios || target_os == "freebsd") { if (is_mac || is_ios || target_os == "freebsd") {
defines = [ "HAVE_SCONN_LEN" ] defines += [ "HAVE_SCONN_LEN" ]
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment