mirror of
https://github.com/vlang/v.git
synced 2025-09-13 22:42:26 +03:00
ci,os: fix bootstrapping with -os cross -o vc/v.c
(avoid the generic calls in the new write_u8 and read_u8)
This commit is contained in:
parent
9f5a1b8b4a
commit
ff93ccb29d
1 changed files with 6 additions and 2 deletions
|
@ -57,13 +57,17 @@ pub fn (mut f File) read_be[T]() !T {
|
||||||
// write_u8 writes a single byte value to the file `f`.
|
// write_u8 writes a single byte value to the file `f`.
|
||||||
// Note: if possible, use some of the other APIs, that write larger chunks of data, before using write_u8/1.
|
// Note: if possible, use some of the other APIs, that write larger chunks of data, before using write_u8/1.
|
||||||
pub fn (mut f File) write_u8(b u8) ! {
|
pub fn (mut f File) write_u8(b u8) ! {
|
||||||
return f.write_le[u8](b)
|
C.errno = 0 // needed for tcc
|
||||||
|
check_fwrite(C.fwrite(voidptr(&b), 1, 1, f.cfile))!
|
||||||
}
|
}
|
||||||
|
|
||||||
// read_u8 reads a single byte value from the file `f`.
|
// read_u8 reads a single byte value from the file `f`.
|
||||||
// Note: if possible, use some of the other APIs, that read larger chunks of data, before using read_u8/1.
|
// Note: if possible, use some of the other APIs, that read larger chunks of data, before using read_u8/1.
|
||||||
pub fn (mut f File) read_u8() !u8 {
|
pub fn (mut f File) read_u8() !u8 {
|
||||||
return f.read_le[u8]()
|
mut res := u8(0)
|
||||||
|
C.errno = 0 // needed for tcc
|
||||||
|
check_fread(C.fread(voidptr(&res), 1, 1, f.cfile))!
|
||||||
|
return res
|
||||||
}
|
}
|
||||||
|
|
||||||
// private helpers
|
// private helpers
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue