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

Inline mmc_mk_modelica_array for source FMUs #2397

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions SimulationRuntime/c/meta/meta_modelica.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,17 @@ static void* mmc_mk_rcon(double d)
#endif
return MMC_TAGPTR(p);
}
static void* mmc_mk_modelica_array(base_array_t arr)
{
base_array_t *cpy = mmc_alloc_words(sizeof(arr)/sizeof(void*) + 1);
memcpy(cpy, &arr, sizeof(base_array_t));
clone_base_array_spec(&arr, cpy);
/* Note: The data is hopefully not stack-allocated and can be passed this way */
return cpy;
}
#else
void* mmc_mk_rcon(double d);
void* mmc_mk_modelica_array(base_array_t);
#endif

#include "openmodelica.h"
Expand Down
1 change: 0 additions & 1 deletion SimulationRuntime/c/meta/meta_modelica_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,6 @@ typedef int mmc_switch_type;
#define mmc_mk_integer mmc_mk_icon
#define mmc_mk_boolean mmc_mk_bcon
#define mmc_mk_real mmc_mk_rcon
void* mmc_mk_modelica_array(base_array_t);

void mmc_catch_dummy_fn();

Expand Down