diff options
author | 2016-11-01 15:16:30 +0100 | |
---|---|---|
committer | 2016-11-01 16:19:13 +0000 | |
commit | 3b906b0d9b93a892831ce4d54d1d7ec3956ce2b4 (patch) | |
tree | f1314662dced3e94524e3d5aa203fe8b02cbe84a /vlib | |
parent | a0bc391daf1ded0c0d512cade822675d2bd32a36 (diff) |
vppinfra: add STATIC_ASSERT macro
Change-Id: Icc4e74ae1627c5b97746ed64955a3dc089e3998f
Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'vlib')
-rw-r--r-- | vlib/vlib/node.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/vlib/vlib/node.c b/vlib/vlib/node.c index fccc37ab..23f7ea02 100644 --- a/vlib/vlib/node.c +++ b/vlib/vlib/node.c @@ -433,7 +433,8 @@ register_node (vlib_main_t * vm, vlib_node_registration_t * r) for (i = 0; i < vec_len (rt->errors); i++) rt->errors[i] = vlib_error_set (n->index, i); - ASSERT (sizeof (vlib_node_runtime_t) == 2 * CLIB_CACHE_LINE_BYTES); + STATIC_ASSERT (sizeof (vlib_node_runtime_t) == 2 * CLIB_CACHE_LINE_BYTES, + "Size of vlib_node_runtime_t must be equal to 2 cachelines"); ASSERT (vec_len (n->runtime_data) <= sizeof (vlib_node_runtime_t) - STRUCT_OFFSET_OF (vlib_node_runtime_t, runtime_data)); |