Skip to content

Commit

Permalink
Update vlib/v/gen/c/cgen.v
Browse files Browse the repository at this point in the history
Co-authored-by: Jose Mendoza  <56417208+StunxFS@users.noreply.github.com>
  • Loading branch information
felipensp and StunxFS authored Oct 1, 2024
1 parent 4ccc3ca commit a1a1060
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vlib/v/gen/c/cgen.v
Original file line number Diff line number Diff line change
Expand Up @@ -6247,7 +6247,7 @@ fn (mut g Gen) const_decl_init_later_msvc_string_fixed_array(mod string, name st
cname := g.c_const_name(name)
mut init := strings.new_builder(100)
for i, elem_expr in expr.exprs {
if elem_expr is ast.ArrayInit {
if elem_expr is ast.ArrayInit && elem_expr.is_fixed {
elem_typ := g.typ(elem_expr.typ)
init.writeln(g.expr_string_surround('\tmemcpy(${cname}[${i}], (${elem_typ})',
elem_expr, ', sizeof(${elem_typ}));'))
Expand Down

0 comments on commit a1a1060

Please sign in to comment.