Skip to content

Commit

Permalink
- Added support for #define-macros used in external "C" functions
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@8685 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Apr 18, 2011
1 parent d50ad51 commit 9c1bc68
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Compiler/susan_codegen/SimCode/SimCodeC.tpl
Expand Up @@ -91,6 +91,7 @@ case SIMCODE(__) then
<<
<%simulationFileHeader(simCode)%>
<%externalFunctionIncludes(externalFunctionIncludes)%>
#include "<%fileNamePrefix%>_functions.cpp"
#ifdef _OMC_MEASURE_TIME
int measure_time_flag = 1;
#else
Expand Down Expand Up @@ -1022,6 +1023,7 @@ case EXTOBJINFO(__) then
>>
end functionDeInitializeDataStruc;


template functionInput(ModelInfo modelInfo)
"Generates function in simulation file."
::=
Expand Down Expand Up @@ -2303,7 +2305,7 @@ case SIMCODE(modelInfo=MODELINFO(__), makefileParams=MAKEFILE_PARAMS(__), simula

.PHONY: <%fileNamePrefix%>
<%fileNamePrefix%>: $(MAINFILE) <%fileNamePrefix%>_functions.cpp <%fileNamePrefix%>_functions.h <%fileNamePrefix%>_records.c
<%\t%> $(CXX) -I. -o <%fileNamePrefix%>$(EXEEXT) $(MAINFILE) <%fileNamePrefix%>_functions.cpp <%dirExtra%> <%libsPos1%> <%libsPos2%> -lsim -linteractive $(CFLAGS) $(SENDDATALIBS) $(LDFLAGS) <%match System.os() case "OSX" then "-lf2c" else "-Wl,-Bstatic -lf2c -Wl,-Bdynamic"%> <%fileNamePrefix%>_records.c
<%\t%> $(CXX) -I. -o <%fileNamePrefix%>$(EXEEXT) $(MAINFILE) <%dirExtra%> <%libsPos1%> <%libsPos2%> -lsim -linteractive $(CFLAGS) $(SENDDATALIBS) $(LDFLAGS) <%match System.os() case "OSX" then "-lf2c" else "-Wl,-Bstatic -lf2c -Wl,-Bdynamic"%> <%fileNamePrefix%>_records.c
<%fileNamePrefix%>.conv.cpp: <%fileNamePrefix%>.cpp
<%\t%> $(PERL) <%makefileParams.omhome%>/share/omc/scripts/convert_lines.pl $< $@.tmp
<%\t%> @mv $@.tmp $@
Expand Down Expand Up @@ -2419,10 +2421,10 @@ template functionsHeaderFile(String filePrefix,
extern "C" {
#endif
<%externalFunctionIncludes(includes)%>
<%extraRecordDecls |> rd => recordDeclarationHeader(rd) ;separator="\n"%>
<%match mainFunction case SOME(fn) then functionHeader(fn,true)%>
<%functionHeaders(functions)%>
<%externalFunctionIncludes(includes)%>
#ifdef __cplusplus
}
Expand Down

0 comments on commit 9c1bc68

Please sign in to comment.