mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[embedded] Use the correct standard putchar signature: func putchar(_: CInt) -> CInt
This commit is contained in:
@@ -8,17 +8,18 @@
|
||||
// REQUIRES: OS=macosx || OS=linux-gnu
|
||||
|
||||
@_silgen_name("putchar")
|
||||
func putchar(_: UInt8)
|
||||
@discardableResult
|
||||
func putchar(_: CInt) -> CInt
|
||||
|
||||
public func print(_ s: StaticString, terminator: StaticString = "\n") {
|
||||
var p = s.utf8Start
|
||||
while p.pointee != 0 {
|
||||
putchar(p.pointee)
|
||||
putchar(CInt(p.pointee))
|
||||
p += 1
|
||||
}
|
||||
p = terminator.utf8Start
|
||||
while p.pointee != 0 {
|
||||
putchar(p.pointee)
|
||||
putchar(CInt(p.pointee))
|
||||
p += 1
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user