mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
all: variable sized options
This commit is contained in:
@@ -798,12 +798,17 @@ pub fn get_raw_stdin() []byte {
|
||||
for {
|
||||
pos := buf + offset
|
||||
res := C.ReadFile(h_input, pos, block_bytes, &bytes_read, 0)
|
||||
offset += bytes_read
|
||||
|
||||
if !res {
|
||||
break
|
||||
}
|
||||
offset += bytes_read
|
||||
|
||||
buf = v_realloc(buf, offset + block_bytes + (block_bytes-bytes_read))
|
||||
}
|
||||
|
||||
C.CloseHandle(h_input)
|
||||
|
||||
return array{element_size: 1 data: voidptr(buf) len: offset cap: offset }
|
||||
}
|
||||
} $else {
|
||||
|
||||
@@ -154,3 +154,7 @@ pub fn (mut f File) close() {
|
||||
C.fflush(f.cfile)
|
||||
C.fclose(f.cfile)
|
||||
}
|
||||
|
||||
pub fn debugger_present() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -345,4 +345,11 @@ pub type VectoredExceptionHandler fn(&ExceptionPointers)u32
|
||||
|
||||
pub fn add_vectored_exception_handler(first bool, handler VectoredExceptionHandler) {
|
||||
C.AddVectoredExceptionHandler(u32(first), handler)
|
||||
}
|
||||
}
|
||||
|
||||
// this is defined in builtin_windows.c.v in builtin
|
||||
// fn C.IsDebuggerPresent() bool
|
||||
|
||||
pub fn debugger_present() bool {
|
||||
return C.IsDebuggerPresent()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user