Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
- Do not generate the empty TypeDefinitions section.

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@24963 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adeas31 committed Mar 6, 2015
1 parent 314bdd8 commit d768c90
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions Compiler/Template/CodegenFMU.tpl
Expand Up @@ -383,13 +383,20 @@ template TypeDefinitions(ModelInfo modelInfo, String FMUVersion)
match modelInfo
case MODELINFO(vars=SIMVARS(__)) then
<<
<%TypeDefinitionsHelper(SimCodeUtil.getEnumerationTypes(vars), FMUVersion)%>
>>
end TypeDefinitions;

template TypeDefinitionsHelper(list<SimCodeVar.SimVar> vars, String FMUVersion)
"Generates code for TypeDefinitions for FMU target."
::=
if intGt(listLength(vars), 0) then
<<
<TypeDefinitions>
<%SimCodeUtil.getEnumerationTypes(vars) |> var =>
TypeDefinition(var,FMUVersion)
;separator="\n"%>
<%vars |> var => TypeDefinition(var,FMUVersion) ;separator="\n"%>
</TypeDefinitions>
>>
end TypeDefinitions;
end TypeDefinitionsHelper;

template TypeDefinition(SimVar simVar, String FMUVersion)
::=
Expand Down

0 comments on commit d768c90

Please sign in to comment.