Skip to content

Commit 4d3f6ca

Browse files
Bascyme-no-dev
authored andcommitted
Add quotes around macro value (Issue #2193) (#2197)
* Replaced ARDUINO_VARIANT with const char * Fixed missing return value * Added quotes around defined value in macro (Issue #2193)
1 parent 2db811f commit 4d3f6ca

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Diff for: libraries/ESPmDNS/src/ESPmDNS.cpp

+9-1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,14 @@ License (MIT license):
4343
#include <functional>
4444
#include "esp_wifi.h"
4545

46+
// Add quotes around defined value
47+
#ifdef __IN_ECLIPSE__
48+
#define STR_EXPAND(tok) #tok
49+
#define STR(tok) STR_EXPAND(tok)
50+
#else
51+
#define STR(tok) tok
52+
#endif
53+
4654
static void _on_sys_event(system_event_t *event){
4755
mdns_handle_system_event(NULL, event);
4856
}
@@ -82,7 +90,7 @@ void MDNSResponder::setInstanceName(String name) {
8290

8391
void MDNSResponder::enableArduino(uint16_t port, bool auth){
8492
mdns_txt_item_t arduTxtData[4] = {
85-
{(char*)"board" ,(char*)ARDUINO_VARIANT},
93+
{(char*)"board" ,(char*)STR(ARDUINO_VARIANT)},
8694
{(char*)"tcp_check" ,(char*)"no"},
8795
{(char*)"ssh_upload" ,(char*)"no"},
8896
{(char*)"auth_upload" ,(char*)"no"}

0 commit comments

Comments
 (0)