ci: fix self compilation on windows

pull/9608/head
Delyan Angelov 2021-04-05 15:47:33 +03:00
parent cc8948efcf
commit 90b123c27b
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
2 changed files with 5 additions and 5 deletions

View File

@ -21,7 +21,7 @@ fn C.open(&char, int, ...int) int
fn C.fdopen(fd int, mode &char) &C.FILE
fn C.CopyFile(&u32, &u32, int) int
fn C.CopyFile(&u16, &u16, bool) int
// fn C.lstat(charptr, voidptr) u64
@ -432,13 +432,13 @@ pub fn get_raw_line() string {
max_line_chars := 256
buf := malloc(max_line_chars * 2)
h_input := C.GetStdHandle(C.STD_INPUT_HANDLE)
mut bytes_read := 0
mut bytes_read := u32(0)
if is_atty(0) > 0 {
x := C.ReadConsole(h_input, buf, max_line_chars * 2, &bytes_read, 0)
if !x {
return tos(buf, 0)
}
return string_from_wide2(&u16(buf), bytes_read)
return string_from_wide2(&u16(buf), int(bytes_read))
}
mut offset := 0
for {

View File

@ -39,14 +39,14 @@ fn find_windows_kit_internal(key RegKey, versions []string) ?string {
$if windows {
unsafe {
for version in versions {
required_bytes := 0 // TODO mut
required_bytes := u32(0) // TODO mut
result := C.RegQueryValueEx(key, version.to_wide(), 0, 0, 0, &required_bytes)
length := required_bytes / 2
if result != 0 {
continue
}
alloc_length := (required_bytes + 2)
mut value := &u16(malloc(alloc_length))
mut value := &u16(malloc(int(alloc_length)))
if isnil(value) {
continue
}