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:
Delyan Angelov 2025-02-27 13:59:24 +02:00
parent 9f5a1b8b4a
commit ff93ccb29d
No known key found for this signature in database
GPG key ID: 66886C0F12D595ED

View file

@ -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