Skip to content

Commit

Permalink
Add quotes around macro value (Issue #2193) (#2197)
Browse files Browse the repository at this point in the history
* Replaced ARDUINO_VARIANT with const char

* Fixed missing return value

* Added quotes around defined value in macro (Issue #2193)
  • Loading branch information
Bascy authored and me-no-dev committed Dec 16, 2018
1 parent 2db811f commit 4d3f6ca
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion libraries/ESPmDNS/src/ESPmDNS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ License (MIT license):
#include <functional>
#include "esp_wifi.h"

// Add quotes around defined value
#ifdef __IN_ECLIPSE__
#define STR_EXPAND(tok) #tok
#define STR(tok) STR_EXPAND(tok)
#else
#define STR(tok) tok
#endif

static void _on_sys_event(system_event_t *event){
mdns_handle_system_event(NULL, event);
}
Expand Down Expand Up @@ -82,7 +90,7 @@ void MDNSResponder::setInstanceName(String name) {

void MDNSResponder::enableArduino(uint16_t port, bool auth){
mdns_txt_item_t arduTxtData[4] = {
{(char*)"board" ,(char*)ARDUINO_VARIANT},
{(char*)"board" ,(char*)STR(ARDUINO_VARIANT)},
{(char*)"tcp_check" ,(char*)"no"},
{(char*)"ssh_upload" ,(char*)"no"},
{(char*)"auth_upload" ,(char*)"no"}
Expand Down

0 comments on commit 4d3f6ca

Please sign in to comment.