-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optionally backs Pigweed's std::span polyfill with PW_ASSERT() rather than always disabling assert checks. Bug: b/234873709 Change-Id: I2c0a316a9c7f0753fb3f0d81d93715512989d420 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/59496 Reviewed-by: Tom Craig <[email protected]> Reviewed-by: Wyatt Hepler <[email protected]> Pigweed-Auto-Submit: Armando Montanez <[email protected]> Commit-Queue: Auto-Submit <[email protected]>
- Loading branch information
1 parent
4e7d9a1
commit 16116ae
Showing
9 changed files
with
131 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Copyright 2022 The Pigweed Authors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); you may not | ||
// use this file except in compliance with the License. You may obtain a copy of | ||
// the License at | ||
// | ||
// https://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
// License for the specific language governing permissions and limitations under | ||
// the License. | ||
#pragma once | ||
|
||
// PW_SPAN_ENABLE_ASSERTS controls whether pw_span's implementation includes | ||
// asserts for detecting disallowed span operations at runtime. For C++20 and | ||
// later, this replaces std::span with the custom implementation in pw_span to | ||
// ensure bounds-checking asserts have been enabled. | ||
// | ||
// This defaults to disabled because of the significant increase in code size | ||
// caused by enabling this feature. It's strongly recommended to enable this | ||
// in debug and testing builds. | ||
#if !defined(PW_SPAN_ENABLE_ASSERTS) | ||
#define PW_SPAN_ENABLE_ASSERTS 0 | ||
#endif // !defined(PW_SPAN_ENABLE_ASSERTS) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters