mirror of
https://github.com/vlang/v.git
synced 2025-09-14 09:56:16 -04:00
cgen: fix myarr [1]C.mytype
fixed array fields, for pub type C.mytype = voidptr
(#21266)
This commit is contained in:
parent
dc763422c5
commit
9ed33718f3
@ -6570,9 +6570,6 @@ fn (mut g Gen) write_types(symbols []&ast.TypeSymbol) {
|
|||||||
}
|
}
|
||||||
len := sym.info.size
|
len := sym.info.size
|
||||||
if len > 0 {
|
if len > 0 {
|
||||||
if fixed_elem_name.starts_with('C__') {
|
|
||||||
fixed_elem_name = fixed_elem_name[3..]
|
|
||||||
}
|
|
||||||
if elem_sym.info is ast.FnType {
|
if elem_sym.info is ast.FnType {
|
||||||
pos := g.out.len
|
pos := g.out.len
|
||||||
g.write_fn_ptr_decl(&elem_sym.info, '')
|
g.write_fn_ptr_decl(&elem_sym.info, '')
|
||||||
|
9
vlib/v/tests/array_fixed_c_test.v
Normal file
9
vlib/v/tests/array_fixed_c_test.v
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
type C.ArrFixedCTestType = voidptr
|
||||||
|
|
||||||
|
struct WrapperStruct {
|
||||||
|
mut:
|
||||||
|
arr_fixed_c_type [1]C.ArrFixedCTestType
|
||||||
|
}
|
||||||
|
|
||||||
|
fn test_main() {
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user