Skip to content

Commit

Permalink
checker: fix C.xx = C.yy aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
medvednikov committed Oct 15, 2023
1 parent c947c14 commit 4bc9a8f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
18 changes: 8 additions & 10 deletions vlib/builtin/builtin_windows.c.v
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion vlib/v/checker/checker.v
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 4bc9a8f

Please sign in to comment.