Skip to content

Commit 9ed3371

Browse files
authored
cgen: fix myarr [1]C.mytype fixed array fields, for pub type C.mytype = voidptr (#21266)
1 parent dc76342 commit 9ed3371

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

vlib/v/gen/c/cgen.v

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6570,9 +6570,6 @@ fn (mut g Gen) write_types(symbols []&ast.TypeSymbol) {
65706570
}
65716571
len := sym.info.size
65726572
if len > 0 {
6573-
if fixed_elem_name.starts_with('C__') {
6574-
fixed_elem_name = fixed_elem_name[3..]
6575-
}
65766573
if elem_sym.info is ast.FnType {
65776574
pos := g.out.len
65786575
g.write_fn_ptr_decl(&elem_sym.info, '')

vlib/v/tests/array_fixed_c_test.v

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
type C.ArrFixedCTestType = voidptr
2+
3+
struct WrapperStruct {
4+
mut:
5+
arr_fixed_c_type [1]C.ArrFixedCTestType
6+
}
7+
8+
fn test_main() {
9+
}

0 commit comments

Comments
 (0)