Skip to content

Commit

Permalink
- use brackets to avoid warning in tables.c
Browse files Browse the repository at this point in the history
- update cmakefiles and small change to simulation_runtime_cpp to get simulationruntime c compilable with vs2010

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@13497 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Jens Frenkel committed Oct 19, 2012
1 parent 5f79278 commit 7c1d635
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion SimulationRuntime/c/ModelicaExternalC/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ add_library(ModelicaExternalC ${ModelicaExternalC_sources} ${ModelicaExternalC_
# Install
INSTALL(TARGETS ModelicaExternalC
ARCHIVE DESTINATION lib)
INSTALL(FILES f2c.h DESTINATION include)
INSTALL(FILES ${ModelicaExternalC_headers} DESTINATION include)

2 changes: 1 addition & 1 deletion SimulationRuntime/c/ModelicaExternalC/tables.c
Original file line number Diff line number Diff line change
Expand Up @@ -1150,7 +1150,7 @@ InterpolationTable2D* InterpolationTable2D_init(int ipoType, const char* tableNa
InterpolationTable2D *tpl = 0;
tpl = (InterpolationTable2D*)calloc(1,sizeof(InterpolationTable2D));
ASSERT1(tpl,"Not enough memory for Table: %s",tableName);
ASSERT3(0 < ipoType & ipoType < 3,"Unknown interpolation Type %d for Table %s from file %s!",ipoType,tableName,fileName);
ASSERT3((0 < ipoType) & (ipoType < 3),"Unknown interpolation Type %d for Table %s from file %s!",ipoType,tableName,fileName);

tpl->rows = tableDim1;
tpl->cols = tableDim2;
Expand Down
2 changes: 1 addition & 1 deletion SimulationRuntime/c/meta/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ add_library(meta ${META_SRC} ${META_HFILES})

# Install
INSTALL(TARGETS meta
ARCHIVE DESTINATION meta)
ARCHIVE DESTINATION lib)
INSTALL(FILES ${META_HFILES} DESTINATION include/meta)

2 changes: 1 addition & 1 deletion SimulationRuntime/c/simulation/simulation_runtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,7 @@ static void omc_throw_simulation()
{
terminationAssert = 1;
setTermMsg("Assertion triggered by external C function");
TermInfo = (FILE_INFO){"",-1,-1,-1,-1,1};
set_struct(FILE_INFO,TermInfo,omc_dummyFileInfo);
}

void (*omc_assert)(const char *msg, FILE_INFO info) = omc_assert_simulation;
Expand Down
7 changes: 7 additions & 0 deletions SimulationRuntime/c/simulation_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@
#define omc_dummyEquationInfo {-1,"",-1,NULL}
#define omc_dummyFunctionInfo {-1,"",omc_dummyFileInfo}

#if defined(_MSC_VER)
#define set_struct(TYPE, x, info) { const TYPE tmp = info; x = tmp; }
#else
#define set_struct(TYPE, x, info) x = (TYPE)info
#endif


/* Model info structures */
typedef struct VAR_INFO
{
Expand Down

0 comments on commit 7c1d635

Please sign in to comment.