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 3, 2023
1 parent d1c6c35 commit bc27fea
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 @@ -657,7 +657,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 @@ -1043,6 +1042,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 bc27fea

Please # to comment.