element: Remove DHCP element
[framework/connectivity/connman.git] / include / plugin.h
index 350937e..4b9d540 100644 (file)
@@ -2,7 +2,7 @@
  *
  *  Connection Manager
  *
- *  Copyright (C) 2007-2009  Intel Corporation. All rights reserved.
+ *  Copyright (C) 2007-2010  Intel Corporation. All rights reserved.
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License version 2 as
@@ -78,11 +78,19 @@ struct connman_plugin_desc {
  *                                     example_init, example_exit)
  * ]|
  */
-#define CONNMAN_PLUGIN_DEFINE(name, description, version, init, exit) \
+#ifdef CONNMAN_PLUGIN_BUILTIN
+#define CONNMAN_PLUGIN_DEFINE(name, description, version, priority, init, exit) \
+               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, \
-                       CONNMAN_PLUGIN_PRIORITY_DEFAULT, init, exit \
+                       #name, description, version, priority, init, exit \
                };
+#endif
 
 #ifdef __cplusplus
 }