Skip to content

Commit 36b96da

Browse files
authored
Define OPENMODELICA_H_ for external includes (#9830)
- Will be used by Modelica libraries that check if a specific tool is used, e.g. TILMedia.
1 parent d809d73 commit 36b96da

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

OMCompiler/Compiler/Template/CodegenCFunctions.tpl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,13 +289,17 @@ end commonHeader;
289289

290290
/* public */ template externalFunctionIncludes(list<String> includes)
291291
"Generates external includes part in function files.
292-
used in Compiler/Template/CodegenFMU.tpl"
292+
used in Compiler/Template/CodegenFMU.tpl.
293+
Include openmodelica.h, because some Modelica libraries test if some tool depedent variable is set, e.g. TILMedia."
293294
::=
294295
if includes then
295296
<<
296297
#ifdef __cplusplus
297298
extern "C" {
298299
#endif
300+
#include "openmodelica.h" // Defines OPENMODELICA_H_ for libraris to test if called from OpenModelica.
301+
#include "ModelicaUtilities.h" // Make Modelica C util functions available for external includes.
302+
299303
<% (includes ;separator="\n") %>
300304
#ifdef __cplusplus
301305
}

0 commit comments

Comments
 (0)