cgen: fix const fixed array of reference var using correct pointer (#13023)
parent
59ed4be49a
commit
054bb272df
|
@ -1132,15 +1132,8 @@ pub fn (mut g Gen) write_typedef_types() {
|
||||||
// .array_fixed {
|
// .array_fixed {
|
||||||
styp := sym.cname
|
styp := sym.cname
|
||||||
// array_fixed_char_300 => char x[300]
|
// array_fixed_char_300 => char x[300]
|
||||||
mut fixed := styp[12..]
|
|
||||||
len := styp.after('_')
|
len := styp.after('_')
|
||||||
fixed = fixed[..fixed.len - len.len - 1]
|
mut fixed := g.typ(info.elem_type)
|
||||||
if fixed.starts_with('C__') {
|
|
||||||
fixed = fixed[3..]
|
|
||||||
}
|
|
||||||
if fixed.contains('ptr') {
|
|
||||||
fixed = 'void*'
|
|
||||||
}
|
|
||||||
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, '')
|
||||||
|
|
Loading…
Reference in New Issue