Skip to content
This repository was archived by the owner on May 18, 2019. It is now read-only.

Commit f5e1d77

Browse files
sjoelundOpenModelica-Hudson
authored andcommitted
Inline mmc_mk_modelica_array for source FMUs
This fixes ticket:4899. Belonging to [master]: - #2393
1 parent 549896e commit f5e1d77

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

SimulationRuntime/c/meta/meta_modelica.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,17 @@ static void* mmc_mk_rcon(double d)
209209
#endif
210210
return MMC_TAGPTR(p);
211211
}
212+
static void* mmc_mk_modelica_array(base_array_t arr)
213+
{
214+
base_array_t *cpy = mmc_alloc_words(sizeof(arr)/sizeof(void*) + 1);
215+
memcpy(cpy, &arr, sizeof(base_array_t));
216+
clone_base_array_spec(&arr, cpy);
217+
/* Note: The data is hopefully not stack-allocated and can be passed this way */
218+
return cpy;
219+
}
212220
#else
213221
void* mmc_mk_rcon(double d);
222+
void* mmc_mk_modelica_array(base_array_t);
214223
#endif
215224

216225
#include "openmodelica.h"

SimulationRuntime/c/meta/meta_modelica_data.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,6 @@ typedef int mmc_switch_type;
229229
#define mmc_mk_integer mmc_mk_icon
230230
#define mmc_mk_boolean mmc_mk_bcon
231231
#define mmc_mk_real mmc_mk_rcon
232-
void* mmc_mk_modelica_array(base_array_t);
233232

234233
void mmc_catch_dummy_fn();
235234

0 commit comments

Comments
 (0)