Skip to content

Commit

Permalink
Allow struct predeclaration (#175)
Browse files Browse the repository at this point in the history
Co-authored-by: Martin Weismann <[email protected]>
  • Loading branch information
woodwan and martinweismann authored Aug 2, 2022
1 parent 496b4d4 commit 4801967
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Source/languagec.go
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,11 @@ func buildCCPPStructs(component ComponentDefinition, w LanguageWriter, NameSpace

for i := 0; i < len(component.Structs); i++ {
structinfo := component.Structs[i];
w.Writeln("typedef struct {");
if (useCPPTypes) {
w.Writeln("typedef struct s%s {", structinfo.Name);
} else {
w.Writeln("typedef struct s%s%s {", NameSpace, structinfo.Name);
}

for j := 0; j < len(structinfo.Members); j++ {
member := structinfo.Members[j];
Expand Down

0 comments on commit 4801967

Please sign in to comment.