From 4bc9a8f8d8951edcb698dab4e4dd6dc86a3cebe7 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Sun, 15 Oct 2023 16:18:00 +0300 Subject: [PATCH] checker: fix C.xx = C.yy aliases --- vlib/builtin/builtin_windows.c.v | 18 ++++++++---------- vlib/v/checker/checker.v | 2 +- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/vlib/builtin/builtin_windows.c.v b/vlib/builtin/builtin_windows.c.v index 0f0cd8165d..6f38acc72b 100644 --- a/vlib/builtin/builtin_windows.c.v +++ b/vlib/builtin/builtin_windows.c.v @@ -9,23 +9,21 @@ __global g_original_codepage = u32(0) pub type C.BOOL = bool -pub struct C.HINSTANCE {} +pub type C.HINSTANCE = voidptr -pub struct C.HICON {} +pub type C.HICON = voidptr -pub struct C.HCURSOR {} +pub type C.HCURSOR = voidptr -pub struct C.HCURSOR {} +pub type C.HBRUSH = voidptr -pub struct C.HBRUSH {} +pub type C.HWND = voidptr -pub struct C.HWND {} +pub type C.HGLOBAL = voidptr -pub struct C.HGLOBAL {} +pub type C.HANDLE = voidptr -pub struct C.HANDLE {} - -pub struct C.LRESULT {} +pub type C.LRESULT = voidptr // utf8 to stdout needs C.SetConsoleOutputCP(cp_utf8) fn C.GetConsoleOutputCP() u32 diff --git a/vlib/v/checker/checker.v b/vlib/v/checker/checker.v index c8468a927e..65017d922b 100644 --- a/vlib/v/checker/checker.v +++ b/vlib/v/checker/checker.v @@ -499,7 +499,7 @@ fn (mut c Checker) type_decl(node ast.TypeDecl) { } fn (mut c Checker) alias_type_decl(node ast.AliasTypeDecl) { - if c.file.mod.name != 'builtin' && c.file.mod.name != 'time' { + if c.file.mod.name != 'builtin' && !node.name.starts_with('C.') { c.check_valid_pascal_case(node.name, 'type alias', node.pos) } if !c.ensure_type_exists(node.parent_type, node.type_pos) {