1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

Support for the printf optimisation for windows and wide strings

This commit is contained in:
F1ssi0N
2019-07-27 16:28:22 +01:00
committed by Alexander Medvednikov
parent 3794129c91
commit acd28fa495
4 changed files with 27 additions and 7 deletions

View File

@ -51,7 +51,9 @@ pub fn println(s string) {
panic('println(NIL)')
}
$if windows {
C._putws(s.to_wide())
// HACKY HACK
// use capital s for printing regular ascii strings
C.wprintf(C.TEXT('%.*S\n'), s.len, s)
} $else {
C.printf('%.*s\n', s.len, s.str)
}