Skip to content

Commit

Permalink
Fix compile time checks.
Browse files Browse the repository at this point in the history
Signed-off-by: Rule Timothy (VM/EMT3) <[email protected]>
  • Loading branch information
timrulebosch committed Sep 12, 2024
1 parent 4176379 commit 24605f7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dse/modelc/model/gateway.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ __attribute__((unused)) static void __compile_time_checks(void)
{
// Compile-time type size check. Get actual size with:
// char(*___)[sizeof(ModelGatewayDesc)] = 1;
#if __SIZEOF_POINTER__ == 8
_Static_assert(sizeof(ModelGatewayDesc) == 80, "Compatibility FAIL!");
#endif
}


Expand Down
2 changes: 2 additions & 0 deletions dse/modelc/model/mcl.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ __attribute__((unused)) static void __compile_time_checks(void)
// Compile-time type size check. Get actual size with:
// char(*___)[sizeof(MclDesc)] = 1;
// char(*___)[sizeof(MarshalSignalMap)] = 1;
#if __SIZEOF_POINTER__ == 8
_Static_assert(sizeof(MclDesc) == 272, "Compatibility FAIL!");
_Static_assert(sizeof(MarshalSignalMap) == 56, "Compatibility FAIL!");
#endif
}


Expand Down
2 changes: 2 additions & 0 deletions dse/modelc/model/model.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@ __attribute__((unused)) static void __compile_time_checks(void)
// char(*___)[sizeof(ModelDesc)] = 1;
// char(*___)[sizeof(ModelCArguments)] = 1;
// char(*___)[sizeof(RuntimeModelDesc)] = 1;
#if __SIZEOF_POINTER__ == 8
_Static_assert(sizeof(SimulationSpec) == 104, "Compatibility FAIL!");
_Static_assert(sizeof(ModelInstanceSpec) == 160, "Compatibility FAIL!");
_Static_assert(sizeof(ModelDesc) == 112, "Compatibility FAIL!");
_Static_assert(sizeof(ModelCArguments) == 160, "Compatibility FAIL!");
_Static_assert(sizeof(RuntimeModelDesc) == 272, "Compatibility FAIL!");
#endif
}


Expand Down
2 changes: 2 additions & 0 deletions dse/modelc/model/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ __attribute__((unused)) static void __compile_time_checks(void)
{
// Compile-time type size check. Get actual size with:
// char (*___)[sizeof(SignalVector)] = 1;
#if __SIZEOF_POINTER__ == 8
_Static_assert(sizeof(SignalVector) == 256, "Compatibility FAIL!");
#endif
}


Expand Down

0 comments on commit 24605f7

Please sign in to comment.