summaryrefslogtreecommitdiffstats
path: root/src/module-simple-protocol.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/module-simple-protocol.c')
-rw-r--r--src/module-simple-protocol.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/module-simple-protocol.c b/src/module-simple-protocol.c
index c25ff06a..905594c6 100644
--- a/src/module-simple-protocol.c
+++ b/src/module-simple-protocol.c
@@ -3,7 +3,19 @@
#include "module.h"
#include "socket-server.h"
-#include "protocol-simple.h"
+
+#ifdef USE_PROTOCOL_SIMPLE
+ #include "protocol-simple.h"
+ #define protocol_free protcol_simple_free
+#else
+ #ifdef USE_PROTOCOL_CLI
+ #include "protocol-cli.h"
+ #define protocol_new protocol_cli_new
+ #define protocol_free protocol_cli_free
+ #else
+ #error "Broken build system"
+ #endif
+#endif
int module_init(struct core *c, struct module*m) {
struct socket_server *s;
@@ -17,7 +29,12 @@ int module_init(struct core *c, struct module*m) {
return -1;
#endif
+#ifdef USE_PROTOCOL_SIMPLE
m->userdata = protocol_simple_new(c, s, PROTOCOL_SIMPLE_PLAYBACK);
+#else
+ m->userdata = protocol_new(c, s);
+#endif
+
assert(m->userdata);
return 0;
}