aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/feature
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2018-08-10 22:39:11 +0200
committerDamjan Marion <dmarion@me.com>2018-08-13 14:33:54 +0000
commit6e36351faf5b69a0bfb8235b3b06f8b2c24e5547 (patch)
tree512c92bda1a48604fbfbc7bbbb1e4b613cdba614 /src/vnet/feature
parent3bf6c2bfe59be62169a1245340722481b0b53870 (diff)
Multiarch handling in different constructor macros
This significantly reduces need for ... in multiarch code. Simply constructor macros will jost create static unused entry if CLIB_MARCH_VARIANT is defined and that will be optimized out by compiler. Change-Id: I17d1c4ac0c903adcfadaa4a07de1b854c7ab14ac Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vnet/feature')
-rw-r--r--src/vnet/feature/feature.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/vnet/feature/feature.h b/src/vnet/feature/feature.h
index 88a919f083a..eb9b7b06243 100644
--- a/src/vnet/feature/feature.h
+++ b/src/vnet/feature/feature.h
@@ -99,6 +99,7 @@ typedef struct
extern vnet_feature_main_t feature_main;
+#ifndef CLIB_MARCH_VARIANT
#define VNET_FEATURE_ARC_INIT(x,...) \
__VA_ARGS__ vnet_feature_arc_registration_t vnet_feat_arc_##x;\
static void __vnet_add_feature_arc_registration_##x (void) \
@@ -138,6 +139,14 @@ static void __vnet_rm_feature_registration_##x (void) \
VLIB_REMOVE_FROM_LINKED_LIST (fm->next_feature, r, next); \
} \
__VA_ARGS__ vnet_feature_registration_t vnet_feat_##x
+#else
+#define VNET_FEATURE_ARC_INIT(x,...) \
+extern vnet_feature_arc_registration_t __clib_unused vnet_feat_arc_##x; \
+static vnet_feature_arc_registration_t __clib_unused __clib_unused_vnet_feat_arc_##x
+#define VNET_FEATURE_INIT(x,...) \
+extern vnet_feature_registration_t __clib_unused vnet_feat_##x; \
+static vnet_feature_registration_t __clib_unused __clib_unused_vnet_feat_##x
+#endif
void
vnet_config_update_feature_count (vnet_feature_main_t * fm, u8 arc,