From: Marcel Holtmann Date: Thu, 23 Apr 2009 11:59:01 +0000 (+0100) Subject: Add initial steps for builtin plugins X-Git-Tag: accepted/2.0alpha-wayland/20121110.002834~3838 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c999302dcb52b293fb125cfe17ded412787322b7;p=profile%2Fivi%2Fconnman.git Add initial steps for builtin plugins --- diff --git a/include/plugin.h b/include/plugin.h index 086786c..21ecd0e 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 1b57365..36e816b 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -27,6 +27,10 @@ #include +#ifdef CONNMAN_PLUGIN_BUILTIN +#undef CONNMAN_PLUGIN_BUILTIN +#endif + #include "connman.h" static GSList *plugins = NULL;