Skip to content

Commit

Permalink
cgen: fix myarr [1]C.mytype fixed array fields, for `pub type C.myt…
Browse files Browse the repository at this point in the history
…ype = voidptr` (#21266)
  • Loading branch information
antono2 committed Apr 24, 2024
1 parent dc76342 commit 9ed3371
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
3 changes: 0 additions & 3 deletions vlib/v/gen/c/cgen.v
Original file line number Diff line number Diff line change
Expand Up @@ -6570,9 +6570,6 @@ fn (mut g Gen) write_types(symbols []&ast.TypeSymbol) {
}
len := sym.info.size
if len > 0 {
if fixed_elem_name.starts_with('C__') {
fixed_elem_name = fixed_elem_name[3..]
}
if elem_sym.info is ast.FnType {
pos := g.out.len
g.write_fn_ptr_decl(&elem_sym.info, '')
Expand Down
9 changes: 9 additions & 0 deletions vlib/v/tests/array_fixed_c_test.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
type C.ArrFixedCTestType = voidptr

struct WrapperStruct {
mut:
arr_fixed_c_type [1]C.ArrFixedCTestType
}

fn test_main() {
}

0 comments on commit 9ed3371

Please sign in to comment.