[Spice-devel] [PATCH 2/2] Add a macro to deal with the boilerplate of writing a streaming agent plugin

Christophe de Dinechin christophe at dinechin.org
Fri Mar 23 12:05:24 UTC 2018


From: Christophe de Dinechin <dinechin at redhat.com>

Signed-off-by: Christophe de Dinechin <dinechin at redhat.com>
---
 include/spice-streaming-agent/plugin.hpp | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/include/spice-streaming-agent/plugin.hpp b/include/spice-streaming-agent/plugin.hpp
index 0ec5040..b01cd82 100644
--- a/include/spice-streaming-agent/plugin.hpp
+++ b/include/spice-streaming-agent/plugin.hpp
@@ -152,6 +152,14 @@ extern "C" unsigned spice_streaming_agent_plugin_interface_version;
  */
 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::PluginInterfaceVersion;                 \
+                                                                        \
+    __attribute__ ((visibility ("default")))                            \
+    bool spice_streaming_agent_plugin_init(spice::streaming_agent::Agent* agent)
+
 #endif
 
 #endif // SPICE_STREAMING_AGENT_PLUGIN_HPP
-- 
2.13.5 (Apple Git-94)



More information about the Spice-devel mailing list