Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
felipensp committed Nov 19, 2023
1 parent 28e8b8b commit 266115f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions vlib/v/gen/c/struct.v
Original file line number Diff line number Diff line change
Expand Up @@ -473,14 +473,16 @@ fn (mut g Gen) struct_decl(s ast.Struct, name string, is_anon bool) {
return
} else if s.is_union {
if g.is_cc_msvc && aligned_attr != '' {
g.type_definitions.writeln('${aligned_attr} ')
g.type_definitions.writeln('union ${aligned_attr} ${name} {')
} else {
g.type_definitions.writeln('union ${name} {')
}
g.type_definitions.writeln('union ${name} {')
} else {
if g.is_cc_msvc && aligned_attr != '' {
g.type_definitions.writeln('${aligned_attr} ')
g.type_definitions.writeln('struct ${aligned_attr} ${name} {')
} else {
g.type_definitions.writeln('struct ${name} {')
}
g.type_definitions.writeln('struct ${name} {')
}

if s.fields.len > 0 || s.embeds.len > 0 {
Expand Down

0 comments on commit 266115f

Please sign in to comment.