From ff93ccb29d04d25df2500d60f9bdf3dc5832a70a Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Thu, 27 Feb 2025 13:59:24 +0200 Subject: [PATCH] ci,os: fix bootstrapping with `-os cross -o vc/v.c` (avoid the generic calls in the new write_u8 and read_u8) --- vlib/os/file_le_be.c.v | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/vlib/os/file_le_be.c.v b/vlib/os/file_le_be.c.v index 1760060b1d..6b746c5a36 100644 --- a/vlib/os/file_le_be.c.v +++ b/vlib/os/file_le_be.c.v @@ -57,13 +57,17 @@ pub fn (mut f File) read_be[T]() !T { // 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. 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`. // 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 { - 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