Skip to content
Snippets Groups Projects
Commit af940c63 authored by Adrien Béraud's avatar Adrien Béraud
Browse files

proxy: mute unused variable warning if disabled

parent 15da5023
Branches
Tags
No related merge requests found
...@@ -49,6 +49,8 @@ public: ...@@ -49,6 +49,8 @@ public:
virtual void setPushNotificationToken(const std::string& token) { virtual void setPushNotificationToken(const std::string& token) {
#ifdef OPENDHT_PUSH_NOTIFICATIONS #ifdef OPENDHT_PUSH_NOTIFICATIONS
deviceKey_ = token; deviceKey_ = token;
#else
(void) token;
#endif #endif
} }
......
...@@ -1037,6 +1037,8 @@ DhtProxyClient::pushNotificationReceived(const std::map<std::string, std::string ...@@ -1037,6 +1037,8 @@ DhtProxyClient::pushNotificationReceived(const std::map<std::string, std::string
} catch (const std::exception& e) { } catch (const std::exception& e) {
DHT_LOG.e("Error handling push notification: %s", e.what()); DHT_LOG.e("Error handling push notification: %s", e.what());
} }
#else
(void) notification;
#endif #endif
} }
...@@ -1066,6 +1068,9 @@ DhtProxyClient::resubscribe(const InfoHash& key, Listener& listener) ...@@ -1066,6 +1068,9 @@ DhtProxyClient::resubscribe(const InfoHash& key, Listener& listener)
listener.thread = std::thread([this, req, vcb, filter, state]() { listener.thread = std::thread([this, req, vcb, filter, state]() {
sendListen(req, vcb, filter, state, ListenMethod::RESUBSCRIBE); sendListen(req, vcb, filter, state, ListenMethod::RESUBSCRIBE);
}); });
#else
(void) key;
(void) listener;
#endif #endif
} }
......
...@@ -1077,6 +1077,8 @@ DhtRunner::forwardAllMessages(bool forward) ...@@ -1077,6 +1077,8 @@ DhtRunner::forwardAllMessages(bool forward)
#endif // OPENDHT_PROXY_CLIENT #endif // OPENDHT_PROXY_CLIENT
if (dht_) if (dht_)
dht_->forwardAllMessages(forward); dht_->forwardAllMessages(forward);
#else
(void) forward;
#endif // OPENDHT_PROXY_SERVER #endif // OPENDHT_PROXY_SERVER
} }
...@@ -1089,6 +1091,8 @@ DhtRunner::setPushNotificationToken(const std::string& token) { ...@@ -1089,6 +1091,8 @@ DhtRunner::setPushNotificationToken(const std::string& token) {
pushToken_ = token; pushToken_ = token;
if (dht_via_proxy_) if (dht_via_proxy_)
dht_via_proxy_->setPushNotificationToken(token); dht_via_proxy_->setPushNotificationToken(token);
#else
(void) token;
#endif #endif
} }
...@@ -1104,6 +1108,8 @@ DhtRunner::pushNotificationReceived(const std::map<std::string, std::string>& da ...@@ -1104,6 +1108,8 @@ DhtRunner::pushNotificationReceived(const std::map<std::string, std::string>& da
}); });
} }
cv.notify_all(); cv.notify_all();
#else
(void) data;
#endif #endif
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment