aboutsummaryrefslogtreecommitdiffstats
path: root/src/vppinfra/clib.h
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2017-11-18 08:43:06 -0500
committerFlorin Coras <florin.coras@gmail.com>2017-11-18 17:04:34 +0000
commitcabbee7d8caeafa3959f4559177ae335567aefb4 (patch)
treea2692a381007e78ffb87586cbd6c19521435ed36 /src/vppinfra/clib.h
parent1d6d085d352c8a009cca3bf62fa8975b3b44d90a (diff)
Call a plugin init function by name
Use this macro to arrange init function ordering between friend plugins. Fails in the usual manner if the plugin doesn't exist, or if the init function symbol is AWOL. clib_error_t * thisplug_init (vlib_main_t *vm) { clib_error_t *error = 0; if ((error = vlib_plugin_init_function ("otherplug.so", otherplug_init))) return error; <etc> return error; } VLIB_INIT_FUNCTION(thisplug_init); Change-Id: Ideecaf46bc0b1546e85096e54be8ddef87946565 Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src/vppinfra/clib.h')
-rw-r--r--src/vppinfra/clib.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/vppinfra/clib.h b/src/vppinfra/clib.h
index 33db3b203f9..0d059a0778b 100644
--- a/src/vppinfra/clib.h
+++ b/src/vppinfra/clib.h
@@ -78,6 +78,9 @@
#define CLIB_PACKED(x) x __attribute__ ((packed))
#define CLIB_UNUSED(x) x __attribute__ ((unused))
+/* Make a string from the macro's argument */
+#define CLIB_STRING_MACRO(x) #x
+
#define __clib_unused __attribute__ ((unused))
#define __clib_weak __attribute__ ((weak))
#define __clib_packed __attribute__ ((packed))