From 664ec1f46fccbf878a6be5b928597b2d27be566f Mon Sep 17 00:00:00 2001 From: Sonja Happ Date: Wed, 30 Jan 2019 12:00:53 +0100 Subject: [PATCH] super_node: add some checks for compiler defines WITH_API and WITH_WEB --- lib/super_node.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/super_node.cpp b/lib/super_node.cpp index a87e6899e..246a0ae3a 100644 --- a/lib/super_node.cpp +++ b/lib/super_node.cpp @@ -53,8 +53,12 @@ SuperNode::SuperNode() : affinity(0), hugepages(DEFAULT_NR_HUGEPAGES), stats(0), +#ifdef WITH_API api(this), +#ifdef WITH_WEB web(&api), +#endif +#endif json(nullptr) { nodes.state = STATE_DESTROYED; @@ -470,9 +474,9 @@ void SuperNode::stopInterfaces() void SuperNode::stop() { - int ret; #ifdef WITH_HOOKS + int ret; if (stats > 0) { ret = task_destroy(&task); if (ret) @@ -586,7 +590,7 @@ extern "C" { return ssn->getInterfaces(); } - +#ifdef WITH_WEB struct web * super_node_get_web(struct super_node *sn) { SuperNode *ssn = reinterpret_cast(sn); @@ -594,7 +598,7 @@ extern "C" { return reinterpret_cast(w); } - +#endif struct lws_context * web_get_context(struct web *w) { Web *ws = reinterpret_cast(w);