Skip to content

Commit 11d10eb

Browse files
committed
WIP: debugPrecondition
1 parent 8a42433 commit 11d10eb

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

Sources/System/Util.swift

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,21 @@ internal func valueOrErrno<I: FixedWidthInteger>(
3838

3939
// Run a precondition for debug client builds
4040
internal func _debugPrecondition(
41-
_ condition: @autoclosure () -> Bool, _ message: StaticString = StaticString(),
41+
_ condition: @autoclosure () -> Bool,
42+
_ message: StaticString = StaticString(),
4243
file: StaticString = #file, line: UInt = #line
4344
) {
4445
// Only check in debug mode.
45-
if _slowPath(_isDebugAssertConfiguration()) { precondition(condition()) }
46+
if _slowPath(_isDebugAssertConfiguration()) {
47+
precondition(
48+
condition(), String(describing: message), file: file, line: line)
49+
}
4650
}
4751

4852
extension OpaquePointer {
49-
internal var _isNULL: Bool { OpaquePointer(bitPattern: Int(bitPattern: self)) == nil }
53+
internal var _isNULL: Bool {
54+
OpaquePointer(bitPattern: Int(bitPattern: self)) == nil
55+
}
5056
}
5157

5258
extension Sequence {

0 commit comments

Comments
 (0)