From 70cbaca72831611d0f87f81d0bd9a84248119a85 Mon Sep 17 00:00:00 2001 From: Rocha Euripedes Date: Wed, 31 May 2023 19:16:49 +0800 Subject: [PATCH] Merge branch 'bugfix/cpp_compilation' into 'master' Fix: Compilation in C++ with multiple subscribe See merge request espressif/esp-mqtt!171 (cherry picked from commit 88413ec3f27102daa805ae1992dd145b42d4690d) 47da99fb Fix: Compilation in C++ with multiple subscribe --- include/mqtt_client.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/mqtt_client.h b/include/mqtt_client.h index f103794..a5933af 100644 --- a/include/mqtt_client.h +++ b/include/mqtt_client.h @@ -426,6 +426,11 @@ esp_err_t esp_mqtt_client_disconnect(esp_mqtt_client_handle_t client); esp_err_t esp_mqtt_client_stop(esp_mqtt_client_handle_t client); +#ifdef __cplusplus + +#define esp_mqtt_client_subscribe esp_mqtt_client_subscribe_single + +#else /** * @brief Convenience macro to select subscribe function to use. * @@ -445,6 +450,7 @@ esp_err_t esp_mqtt_client_stop(esp_mqtt_client_handle_t client); esp_mqtt_topic_t*: esp_mqtt_client_subscribe_multiple \ )(client_handle, topic_type, qos_or_size) +#endif /* __cplusplus*/ /** * @brief Subscribe the client to defined topic with defined qos *