mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-22 08:22:04 +03:00
more compatibility fixes to IPAddress, restore INADDR_ANY, INADDR_NONE (#5416)
This commit is contained in:
@ -38,7 +38,7 @@ IPAddress::IPAddress(uint8_t first_octet, uint8_t second_octet, uint8_t third_oc
|
||||
(*this)[3] = fourth_octet;
|
||||
}
|
||||
|
||||
IPAddress::IPAddress(uint32_t address) {
|
||||
void IPAddress::ctor32(uint32_t address) {
|
||||
setV4();
|
||||
v4() = address;
|
||||
}
|
||||
@ -172,7 +172,8 @@ bool IPAddress::isValid(const char* arg) {
|
||||
return IPAddress().fromString(arg);
|
||||
}
|
||||
|
||||
CONST IPAddress IPNoAddress; // generic "0.0.0.0" for v4 & v6
|
||||
CONST IPAddress INADDR_ANY; // generic "0.0.0.0" for IPv4 & IPv6
|
||||
const IPAddress INADDR_NONE(255,255,255,255);
|
||||
|
||||
/**************************************/
|
||||
|
||||
|
@ -67,11 +67,15 @@ class IPAddress: public Printable {
|
||||
return reinterpret_cast<const uint8_t*>(&v4());
|
||||
}
|
||||
|
||||
void ctor32 (uint32_t);
|
||||
|
||||
public:
|
||||
// Constructors
|
||||
IPAddress();
|
||||
IPAddress(uint8_t first_octet, uint8_t second_octet, uint8_t third_octet, uint8_t fourth_octet);
|
||||
IPAddress(uint32_t address);
|
||||
IPAddress(uint32_t address) { ctor32(address); }
|
||||
IPAddress(u32_t address) { ctor32(address); }
|
||||
IPAddress(int address) { ctor32(address); }
|
||||
IPAddress(const uint8_t *address);
|
||||
|
||||
bool fromString(const char *address);
|
||||
@ -200,9 +204,9 @@ class IPAddress: public Printable {
|
||||
|
||||
};
|
||||
|
||||
extern CONST IPAddress IPNoAddress;
|
||||
extern CONST IPAddress INADDR_ANY;
|
||||
extern const IPAddress INADDR_NONE;
|
||||
|
||||
#include <lwip/inet.h> // bring definition of INADDR_NONE
|
||||
#include <AddrList.h> // bring interface iterator
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user