Skip to content

touch: declare SetFileTime's handle as voidptr so it compiles on Windows - #203

Closed
metif12 wants to merge 1 commit into
vlang:mainfrom
metif12:fix/touch-windows
Closed

metif12 wants to merge 1 commit into
vlang:mainfrom
metif12:fix/touch-windows

Conversation

@metif12

@metif12 metif12 commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

The \winos-test\ job has been red on \main\ itself, not only on branches, with one error:

\
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 \�oidptr\ and used to return \u32, so the \u32\ in this declaration stopped matching what \lutime\ passes it. \ ouch\ is not in the Windows ignore list, so the Windows build stopped with it.

One word, no behaviour change: the file did not compile, so there was no behaviour to change. Verified by building \src/touch\ with V 0.5.2 on Windows, and \� fmt -verify .\ plus \� run build.vsh\ still pass on Linux.

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

metif12 commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

Folded into #206, which carries this commit plus the whole touch -d and -t work. The same reason as in #204 and #205: GitHub will not accept a base branch in a fork, so the four of them could not be stacked and each showed its ancestors as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant