builtin: fix termux prints (#10595)
parent
4bed4afef7
commit
9651a9796b
|
@ -141,10 +141,10 @@ pub fn eprint(s string) {
|
||||||
[manualfree]
|
[manualfree]
|
||||||
pub fn print(s string) {
|
pub fn print(s string) {
|
||||||
$if android {
|
$if android {
|
||||||
// android print for logcat
|
C.fprintf(C.stdout, c'%.*s', s.len, s.str) // logcat
|
||||||
C.fprintf(C.stdout, c'%.*s', s.len, s.str)
|
}
|
||||||
_write_buf_to_fd(1, s.str, s.len)
|
// no else if for android termux support
|
||||||
} $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 {
|
||||||
|
@ -161,14 +161,14 @@ pub fn println(s string) {
|
||||||
println('println(NIL)')
|
println('println(NIL)')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
$if android {
|
||||||
|
C.fprintf(C.stdout, c'%.*s\n', s.len, s.str) // logcat
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// no else if for android termux support
|
||||||
$if ios {
|
$if ios {
|
||||||
C.WrappedNSLog(s.str)
|
C.WrappedNSLog(s.str)
|
||||||
return
|
return
|
||||||
} $else $if android {
|
|
||||||
// android print for logcat
|
|
||||||
C.fprintf(C.stdout, c'%.*s\n', s.len, s.str)
|
|
||||||
_writeln_to_fd(1, s)
|
|
||||||
return
|
|
||||||
} $else $if freestanding {
|
} $else $if freestanding {
|
||||||
bare_print(s.str, u64(s.len))
|
bare_print(s.str, u64(s.len))
|
||||||
bare_print(c'\n', 1)
|
bare_print(c'\n', 1)
|
||||||
|
|
Loading…
Reference in New Issue