builtin: fix termux prints (#9921)
parent
b406de20df
commit
e05da04b4c
|
@ -119,13 +119,12 @@ pub fn eprintln(s string) {
|
||||||
} else {
|
} else {
|
||||||
C.fprintf(C.stderr, c'%.*s\n', s.len, s.str)
|
C.fprintf(C.stderr, c'%.*s\n', s.len, s.str)
|
||||||
}
|
}
|
||||||
} $else {
|
}
|
||||||
if s.str == 0 {
|
if s.str == 0 {
|
||||||
_ = C.write(2, c'eprintln(NIL)\n', 14)
|
_ = C.write(2, c'eprintln(NIL)\n', 14)
|
||||||
} else {
|
} else {
|
||||||
_ = C.write(2, s.str, s.len)
|
_ = C.write(2, s.str, s.len)
|
||||||
_ = C.write(2, c'\n', 1)
|
_ = C.write(2, c'\n', 1)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
C.fflush(C.stderr)
|
C.fflush(C.stderr)
|
||||||
}
|
}
|
||||||
|
@ -156,12 +155,11 @@ pub fn eprint(s string) {
|
||||||
} else {
|
} else {
|
||||||
C.fprintf(C.stderr, c'%.*s', s.len, s.str)
|
C.fprintf(C.stderr, c'%.*s', s.len, s.str)
|
||||||
}
|
}
|
||||||
} $else {
|
}
|
||||||
if s.str == 0 {
|
if s.str == 0 {
|
||||||
_ = C.write(2, c'eprint(NIL)', 11)
|
_ = C.write(2, c'eprint(NIL)', 11)
|
||||||
} else {
|
} else {
|
||||||
_ = C.write(2, s.str, s.len)
|
_ = C.write(2, s.str, s.len)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
C.fflush(C.stderr)
|
C.fflush(C.stderr)
|
||||||
}
|
}
|
||||||
|
@ -172,7 +170,8 @@ pub fn eprint(s string) {
|
||||||
pub fn print(s string) {
|
pub fn print(s string) {
|
||||||
$if android {
|
$if android {
|
||||||
C.fprintf(C.stdout, c'%.*s', s.len, s.str)
|
C.fprintf(C.stdout, c'%.*s', s.len, s.str)
|
||||||
} $else $if ios {
|
}
|
||||||
|
$if ios {
|
||||||
// TODO: Implement a buffer as NSLog doesn't have a "print"
|
// TODO: Implement a buffer as NSLog doesn't have a "print"
|
||||||
C.WrappedNSLog(s.str)
|
C.WrappedNSLog(s.str)
|
||||||
} $else $if freestanding {
|
} $else $if freestanding {
|
||||||
|
|
Loading…
Reference in New Issue