Problem: V's builtin (vlib/builtin/builtin_windows.c.v) defines:
pub type C.BOOL = int
pub type C.HANDLE = voidptr
pub type C.HWND = voidptr
pub type C.HINSTANCE = voidptr
// ... 12 more
The revosw/windows module (auto-generated from Microsoft winmd metadata) also defines these same types with identical definitions in win32/foundation/mod.c.v. V's checker rejects this:
error: cannot register alias `C.HANDLE`, another type with this name exists
Why it matters: revosw/windows is the only V project providing typed Win32 API bindings generated from Microsoft's official metadata. Any V project that imports it on Windows gets this error because the foundation module is pulled in transitively by every other Win32 module.
Reproduction:
// test.v
import revosw.windows.win32.ui.windowsandmessaging
fn main() {}
v run test.v // → "cannot register alias C.HANDLE"
Where the check lives: vlib/v/checker/checker.v around line 629 — unconditional rejection of duplicate C type registration.
Requested fix (either one):
- V compiler: If a
pub type C.X = T is registered and a second pub type C.X = T arrives with the same underlying type, silently accept it instead of erroring
- V compiler: Provide a flag or attribute like
@[allow_redefinition] for C type aliases
Secondary issue: vlib/dl/dl_windows.c.v:28 tries to return C.BOOL (which is int) as V bool - this is a type mismatch in V's own stdlib on Windows.
Problem: V's builtin (vlib/builtin/builtin_windows.c.v) defines:
The
revosw/windowsmodule (auto-generated from Microsoft winmd metadata) also defines these same types with identical definitions inwin32/foundation/mod.c.v. V's checker rejects this:Why it matters:
revosw/windowsis the only V project providing typed Win32 API bindings generated from Microsoft's official metadata. Any V project that imports it on Windows gets this error because the foundation module is pulled in transitively by every other Win32 module.Reproduction:
Where the check lives:
vlib/v/checker/checker.varound line 629 — unconditional rejection of duplicate C type registration.Requested fix (either one):
pub type C.X = Tis registered and a secondpub type C.X = Tarrives with the same underlying type, silently accept it instead of erroring@[allow_redefinition]for C type aliasesSecondary issue:
vlib/dl/dl_windows.c.v:28tries to returnC.BOOL(which isint) as Vbool- this is a type mismatch in V's own stdlib on Windows.