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

cgen tests

This commit is contained in:
Alexander Medvednikov
2019-12-28 11:02:06 +01:00
parent 379c79025b
commit 651c7e8de1
9 changed files with 145 additions and 29 deletions

View File

@ -96,6 +96,20 @@ pub fn eprintln(s string) {
println(s)
}
pub fn eprint(s string) {
if isnil(s.str) {
panic('eprint(NIL)')
}
$if !windows {
C.fflush(stdout)
C.fflush(stderr)
C.fprintf(stderr, '%.*s', s.len, s.str)
C.fflush(stderr)
return
}
print(s)
}
pub fn print(s string) {
$if windows {
C.wprintf(s.to_wide())