Skip to content

Commit

Permalink
Copy file-level preamble to reactor-specific files
Browse files Browse the repository at this point in the history
See
#1599 (comment)
for discussion
  • Loading branch information
petervdonovan committed Mar 8, 2023
1 parent 8da2ed1 commit 7f68cb8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion org.lflang/src/org/lflang/generator/c/CGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,6 @@ private void generateCodeFor(
) throws IOException {
startTimeStepIsPresentCount = 0;
code.pr(generateDirectives());
code.pr(generateTopLevelPreambles());
code.pr(new CMainFunctionGenerator(targetConfig).generateCode());
// Generate code for each reactor.
generateReactorDefinitions();
Expand Down Expand Up @@ -1044,6 +1043,7 @@ private void generateReactorClass(Reactor reactor) throws IOException {
header.pr("#ifndef " + guardMacro);
header.pr("#define " + guardMacro);
generateReactorClassHeaders(reactor, headerName, header, src);
src.pr(generateTopLevelPreambles());
generateUserPreamblesForReactor(reactor, src);
generateReactorClassBody(reactor, header, src);
header.pr("#endif // " + guardMacro);
Expand Down

0 comments on commit 7f68cb8

Please sign in to comment.