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

fix Windows warnings

This commit is contained in:
Nicolas Sauzede
2019-11-16 00:30:50 +01:00
committed by Alexander Medvednikov
parent e577b40743
commit 1dadf9d966
13 changed files with 92 additions and 61 deletions

View File

@ -162,9 +162,10 @@ fn v_ptr_free(ptr voidptr) {
pub fn is_atty(fd int) int {
$if windows {
mut mode := 0
C.GetConsoleMode(C._get_osfhandle(fd), &mode)
return mode
mut mode := u32(0)
osfh := voidptr(C._get_osfhandle(fd))
C.GetConsoleMode(osfh, voidptr(&mode))
return int(mode)
} $else {
return C.isatty(fd)
}