diff options
-rw-r--r-- | include/plugin.h | 9 | ||||
-rw-r--r-- | src/plugin.c | 4 |
2 files changed, 13 insertions, 0 deletions
diff --git a/include/plugin.h b/include/plugin.h index 086786c4..21ecd0ef 100644 --- a/include/plugin.h +++ b/include/plugin.h @@ -78,12 +78,21 @@ struct connman_plugin_desc { * example_init, example_exit) * ]| */ +#ifdef CONNMAN_PLUGIN_BUILTIN +#define CONNMAN_PLUGIN_DEFINE(name, description, version, priority, init, exit) \ + extern struct connman_plugin_desc connman_builtin_ ## name \ + __attribute__ ((visibility("default"))); \ + struct connman_plugin_desc connman_builtin_ ## name = { \ + #name, description, version, priority, init, exit \ + }; +#else #define CONNMAN_PLUGIN_DEFINE(name, description, version, priority, init, exit) \ extern struct connman_plugin_desc connman_plugin_desc \ __attribute__ ((visibility("default"))); \ struct connman_plugin_desc connman_plugin_desc = { \ #name, description, version, priority, init, exit \ }; +#endif #ifdef __cplusplus } diff --git a/src/plugin.c b/src/plugin.c index 1b573654..36e816bd 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -27,6 +27,10 @@ #include <glib.h> +#ifdef CONNMAN_PLUGIN_BUILTIN +#undef CONNMAN_PLUGIN_BUILTIN +#endif + #include "connman.h" static GSList *plugins = NULL; |