summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe de Dinechin <dinechin@redhat.com>2018-03-23 13:05:24 +0100
committerFrediano Ziglio <fziglio@redhat.com>2018-04-20 18:18:40 +0100
commitf9ad27bb2cdc679e7ab60ce384c51ba850b8b46b (patch)
tree70e7096e3011a590c696525fc6980ee84ee07742
parent04ab561a71d47d6e7de6737076cbab4487840daa (diff)
Add a macro to deal with the boilerplate of writing a streaming agent plugin
Signed-off-by: Christophe de Dinechin <dinechin@redhat.com> Acked-by: Christophe Fergeau <cfergeau@redhat.com>
-rw-r--r--include/spice-streaming-agent/plugin.hpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/spice-streaming-agent/plugin.hpp b/include/spice-streaming-agent/plugin.hpp
index 6784ebc..e9acf2d 100644
--- a/include/spice-streaming-agent/plugin.hpp
+++ b/include/spice-streaming-agent/plugin.hpp
@@ -140,6 +140,15 @@ extern "C" unsigned spice_streaming_agent_plugin_interface_version;
* \return true if plugin should stay loaded, false otherwise
*/
extern "C" spice::streaming_agent::PluginInitFunc spice_streaming_agent_plugin_init;
+
+#define SPICE_STREAMING_AGENT_PLUGIN(agent) \
+ __attribute__ ((visibility ("default"))) \
+ unsigned spice_streaming_agent_plugin_interface_version = \
+ spice::streaming_agent::PluginVersion; \
+ \
+ __attribute__ ((visibility ("default"))) \
+ bool spice_streaming_agent_plugin_init(spice::streaming_agent::Agent* agent)
+
#endif
#endif // SPICE_STREAMING_AGENT_PLUGIN_HPP