From 295e1a06d3ffc55210215738033db75b3ab63d54 Mon Sep 17 00:00:00 2001 From: Francois BIOT Date: Sun, 1 Jan 2023 23:27:45 +0100 Subject: [PATCH] Removed std::make_unique that is not available everywhere --- src/TinyMqtt.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/TinyMqtt.cpp b/src/TinyMqtt.cpp index 12b8038..48ad527 100644 --- a/src/TinyMqtt.cpp +++ b/src/TinyMqtt.cpp @@ -17,7 +17,7 @@ int TinyMqtt::debug=2; MqttBroker::MqttBroker(uint16_t port) { - server = std::make_unique(port); + server = std::unique_ptr(new TcpServer(port)); #ifdef TINY_MQTT_ASYNC server->onClient(onClient, this); #endif @@ -34,7 +34,7 @@ MqttClient::MqttClient(MqttBroker* local_broker, TcpClient* new_client) // client->onConnect() TODO // client->onDisconnect() TODO #else - tcp_client = std::make_unique(*new_client); + tcp_client = std::unique_ptr(new WiFiClient(*new_client)); #endif alive = millis()+5000; } @@ -89,7 +89,7 @@ void MqttClient::connect(std::string broker, uint16_t port, uint16_t ka) debug("MqttClient::connect_to_host " << broker << ':' << port); keep_alive = ka; close(); - tcp_client = std::make_unique(); + tcp_client = std::unique_ptr(new TcpClient); #ifdef TINY_MQTT_ASYNC tcp_client->onData(onData, this);