1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-21 10:26:06 +03:00

fix host emulation (#5382)

This commit is contained in:
david gauchard 2018-11-28 12:37:59 +01:00 committed by GitHub
parent 5fcb8f1dac
commit dc5e352676
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 8 deletions

View File

@ -120,8 +120,10 @@ DEBUG += -DDEBUG_ESP_PORT=Serial
DEBUG += -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_MDNS
endif
CXXFLAGS += $(DEBUG) -std=c++11 -Wall -Werror -coverage $(OPTZ) -fno-common -g $(M32)
CFLAGS += -std=c99 -Wall -Werror -coverage $(OPTZ) -fno-common -g $(M32)
FLAGS += $(DEBUG) -Wall -Werror -coverage $(OPTZ) -fno-common -g $(M32)
FLAGS += -DLWIP_IPV6=0
CXXFLAGS += -std=c++11 $(FLAGS)
CFLAGS += -std=c99 $(FLAGS)
LDFLAGS += -coverage $(OPTZ) -g $(M32)
VALGRINDFLAGS += --leak-check=full --track-origins=yes --error-limit=no --show-leak-kinds=all --error-exitcode=999
CXXFLAGS += -Wno-error=format-security # cores/esp8266/Print.cpp:42:24: error: format not a string literal and no format arguments [-Werror=format-security] -- (os_printf_plus(not_the_best_way))

View File

@ -44,7 +44,7 @@ extern "C" const ip_addr_t ip_addr_any = IPADDR4_INIT(IPADDR_ANY);
// lwIP API side of WiFiServer
WiFiServer::WiFiServer (IPAddress addr, uint16_t port)
WiFiServer::WiFiServer (const IPAddress& addr, uint16_t port)
{
(void)addr;
if (port < 1024)

View File

@ -98,7 +98,7 @@ public:
}
}
int connect(ip_addr_t* addr, uint16_t port)
int connect(const ip_addr_t* addr, uint16_t port)
{
return mockConnect(addr->addr, _sock, port);
}

View File

@ -55,16 +55,16 @@ public:
}
}
bool connect (ip_addr_t addr, uint16_t port)
bool connect (const ip_addr_t* addr, uint16_t port)
{
_dst = addr;
_dst = *addr;
_dstport = port;
return true;
}
bool listen(ip_addr_t addr, uint16_t port)
bool listen(const ip_addr_t* addr, uint16_t port)
{
bool ret = mockUDPListen(_sock, addr.addr, port, staticMCastAddr);
bool ret = mockUDPListen(_sock, addr->addr, port, staticMCastAddr);
register_udp(_sock, this);
return ret;
}