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

parser: remove hardcoded check for function calls for C.stat, C.sigaction, etc (#18535)

This commit is contained in:
Delyan Angelov
2023-06-24 08:03:12 +03:00
committed by GitHub
parent 2c7643661e
commit 4c9c515f8b
6 changed files with 24 additions and 17 deletions

View File

@@ -558,7 +558,7 @@ pub fn get_raw_line() string {
mut offset := 0
for {
pos := buf + offset
res := C.ReadFile(h_input, pos, 1, C.LPDWORD(&bytes_read), 0)
res := C.ReadFile(h_input, pos, 1, &u32(&bytes_read), 0)
if !res && offset == 0 {
return tos(buf, 0)
}
@@ -600,7 +600,7 @@ pub fn get_raw_stdin() []u8 {
mut offset := 0
for {
pos := buf + offset
res := C.ReadFile(h_input, pos, block_bytes, C.LPDWORD(&bytes_read), 0)
res := C.ReadFile(h_input, pos, block_bytes, &u32(&bytes_read), 0)
offset += bytes_read
if !res {
break

View File

@@ -449,7 +449,7 @@ pub type VectoredExceptionHandler = fn (&ExceptionPointers) u32
// duplicate definitions from displeasing the compiler
// fn C.AddVectoredExceptionHandler(u32, VectoredExceptionHandler)
pub fn add_vectored_exception_handler(first bool, handler VectoredExceptionHandler) {
C.AddVectoredExceptionHandler(u32(first), C.PVECTORED_EXCEPTION_HANDLER(handler))
C.AddVectoredExceptionHandler(u32(first), voidptr(handler))
}
// uname returns information about the platform on which the program is running.