Skip to content

Commit 9dc482d

Browse files
woodwanmartinweismann
authored andcommitted
Allow struct predeclaration
1 parent 559d379 commit 9dc482d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Source/languagec.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,11 @@ func buildCCPPStructs(component ComponentDefinition, w LanguageWriter, NameSpace
461461

462462
for i := 0; i < len(component.Structs); i++ {
463463
structinfo := component.Structs[i];
464-
w.Writeln("typedef struct {");
464+
if (useCPPTypes) {
465+
w.Writeln("typedef struct s%s {", structinfo.Name);
466+
} else {
467+
w.Writeln("typedef struct s%s%s {", NameSpace, structinfo.Name);
468+
}
465469

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

0 commit comments

Comments
 (0)