From 2df625fb02c789cb4fb6907533b9c305493164d7 Mon Sep 17 00:00:00 2001 From: metif12 Date: Sat, 3 Oct 2026 21:39:19 +0330 Subject: [PATCH] touch: declare SetFileTime's handle as voidptr so it compiles on Windows The Windows CI job has been failing on main, not just on branches: touch/touch_windows.c.v:17:20: error: cannot use oidptr as u32 in argument 1 to C.SetFileTime A HANDLE is a pointer. vlib's C.CreateFileW returns voidptr, and used to return u32, so the u32 in this declaration stopped matching. touch is not in the Windows ignore list, so the whole Windows build stopped with it. One word, no behaviour change: the file did not compile, so there was no behaviour to change. --- src/touch/touch_windows.c.v | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/touch/touch_windows.c.v b/src/touch/touch_windows.c.v index b99e146c..19657b54 100644 --- a/src/touch/touch_windows.c.v +++ b/src/touch/touch_windows.c.v @@ -1,4 +1,7 @@ -fn C.SetFileTime(hfile u32, const_creation_time voidptr, const_access_time voidptr, const_modification_time voidptr) bool +// The handle is a voidptr because that is what vlib's C.CreateFileW returns; +// it used to return u32, and declaring the parameter as u32 is what made this +// file stop compiling on current V. A HANDLE is a pointer either way. +fn C.SetFileTime(hfile voidptr, const_creation_time voidptr, const_access_time voidptr, const_modification_time voidptr) bool fn lutime(path string, acctime int, modtime int) ! { creation_time := t2filetime(-1)