Skip to content

Commit 70cbaca

Browse files
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
1 parent b2bd8e5 commit 70cbaca

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

include/mqtt_client.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,11 @@ esp_err_t esp_mqtt_client_disconnect(esp_mqtt_client_handle_t client);
426426
esp_err_t esp_mqtt_client_stop(esp_mqtt_client_handle_t client);
427427

428428

429+
#ifdef __cplusplus
430+
431+
#define esp_mqtt_client_subscribe esp_mqtt_client_subscribe_single
432+
433+
#else
429434
/**
430435
* @brief Convenience macro to select subscribe function to use.
431436
*
@@ -445,6 +450,7 @@ esp_err_t esp_mqtt_client_stop(esp_mqtt_client_handle_t client);
445450
esp_mqtt_topic_t*: esp_mqtt_client_subscribe_multiple \
446451
)(client_handle, topic_type, qos_or_size)
447452

453+
#endif /* __cplusplus*/
448454
/**
449455
* @brief Subscribe the client to defined topic with defined qos
450456
*

0 commit comments

Comments
 (0)