Skip to content

Commit

Permalink
FMI2 Cpp: remove macro OBJECTCONSTRUCTOR
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@25311 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
rfranke committed Mar 30, 2015
1 parent 0f669b2 commit 1c36ecc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
5 changes: 0 additions & 5 deletions Compiler/Template/CodegenFMUCpp.tpl
Expand Up @@ -168,11 +168,6 @@ case SIMCODE(modelInfo=MODELINFO(__)) then
else
'#include "FMU/FMUWrapper.cpp"'%>

<%if isFMIVersion20(FMUVersion) then
'#define OBJECTCONSTRUCTOR (new FMU2Wrapper(instanceName, GUID, functions, loggingOn))'
else
'#define OBJECTCONSTRUCTOR (new FMUWrapper(instanceName, GUID, functions, loggingOn))'%>

<%if isFMIVersion20(FMUVersion) then
'#include "FMU2/FMU2Interface.cpp"'
else
Expand Down
3 changes: 2 additions & 1 deletion SimulationRuntime/cpp/Include/FMU/FMULibInterface.cpp
Expand Up @@ -57,7 +57,8 @@ extern "C" fmiComponent fmiInstantiateModel(fmiString instanceName, fmiString GU
fmiCallbackFunctions functions, fmiBoolean loggingOn)
{
//LOG_FMI() << "Entry: fmiInstantiateModel" << endl;
return reinterpret_cast<fmiComponent> (OBJECTCONSTRUCTOR);
return reinterpret_cast<fmiComponent>
(new FMUWrapper(instanceName, GUID, functions, loggingOn));
}

extern "C" fmiStatus fmiSetDebugLogging(fmiComponent c, fmiBoolean loggingOn) {
Expand Down
2 changes: 1 addition & 1 deletion SimulationRuntime/cpp/Include/FMU2/FMU2Interface.cpp
Expand Up @@ -76,7 +76,7 @@ extern "C"
{
FMU2Wrapper *w;
try {
w = OBJECTCONSTRUCTOR;
w = new FMU2Wrapper(instanceName, GUID, functions, loggingOn);
}
catch (std::exception &e) {
if (functions && functions->logger)
Expand Down

0 comments on commit 1c36ecc

Please sign in to comment.