mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
v repl: fix println regression on linux
This commit is contained in:
committed by
Alexander Medvednikov
parent
8053175ead
commit
4c3df963fa
@@ -21,14 +21,16 @@ const (
|
||||
fn C.puts(charptr)
|
||||
*/
|
||||
|
||||
pub fn println(s string) {
|
||||
$if linux {
|
||||
$if !android {
|
||||
snl := s + '\n'
|
||||
C.syscall(/* sys_write */ 1, /* stdout_value */ 1, snl.str, s.len+1)
|
||||
return
|
||||
}
|
||||
}
|
||||
pub fn println(s string) {
|
||||
// TODO: a syscall sys_write on linux works, except for the v repl.
|
||||
// Probably it is a stdio buffering issue. Needs more testing...
|
||||
// $if linux {
|
||||
// $if !android {
|
||||
// snl := s + '\n'
|
||||
// C.syscall(/* sys_write */ 1, /* stdout_value */ 1, snl.str, s.len+1)
|
||||
// return
|
||||
// }
|
||||
// }
|
||||
C.printf('%.*s\n', s.len, s.str)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user