mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[embedded] Allow string-interpolating fatalError in Embedded Swift
This commit is contained in:
@@ -527,6 +527,7 @@ public func swift_clearSensitive(buf: UnsafeMutableRawPointer, nbytes: Int) {
|
||||
}
|
||||
|
||||
@usableFromInline
|
||||
@inline(never)
|
||||
func _embeddedReportFatalError(prefix: StaticString, message: StaticString) {
|
||||
print(prefix, terminator: "")
|
||||
if message.utf8CodeUnitCount > 0 { print(": ", terminator: "") }
|
||||
@@ -534,6 +535,7 @@ func _embeddedReportFatalError(prefix: StaticString, message: StaticString) {
|
||||
}
|
||||
|
||||
@usableFromInline
|
||||
@inline(never)
|
||||
func _embeddedReportFatalErrorInFile(prefix: StaticString, message: StaticString, file: StaticString, line: UInt) {
|
||||
print(file, terminator: ":")
|
||||
print(line, terminator: ": ")
|
||||
@@ -541,3 +543,13 @@ func _embeddedReportFatalErrorInFile(prefix: StaticString, message: StaticString
|
||||
if message.utf8CodeUnitCount > 0 { print(": ", terminator: "") }
|
||||
print(message)
|
||||
}
|
||||
|
||||
@usableFromInline
|
||||
@inline(never)
|
||||
func _embeddedReportFatalErrorInFile(prefix: StaticString, message: UnsafeBufferPointer<UInt8>, file: StaticString, line: UInt) {
|
||||
print(file, terminator: ":")
|
||||
print(line, terminator: ": ")
|
||||
print(prefix, terminator: "")
|
||||
if message.count > 0 { print(": ", terminator: "") }
|
||||
print(message)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user