From 91cc6ff4f97f5910738cc2777da6e164bc616479 Mon Sep 17 00:00:00 2001 From: Baruch Even Date: Thu, 24 Mar 2016 09:47:02 +0200 Subject: [PATCH] Avoid multiple instances of INADDR_NONE By moving the definition from the header to the source we now only use one instance for the entire app with a little saving in space. --- cores/esp8266/IPAddress.cpp | 1 + cores/esp8266/IPAddress.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/cores/esp8266/IPAddress.cpp b/cores/esp8266/IPAddress.cpp index f416c7c64..93a081eb2 100644 --- a/cores/esp8266/IPAddress.cpp +++ b/cores/esp8266/IPAddress.cpp @@ -112,3 +112,4 @@ String IPAddress::toString() return String(szRet); } +const IPAddress INADDR_NONE(0, 0, 0, 0); diff --git a/cores/esp8266/IPAddress.h b/cores/esp8266/IPAddress.h index 9248084b2..9e7dfe5e2 100644 --- a/cores/esp8266/IPAddress.h +++ b/cores/esp8266/IPAddress.h @@ -87,6 +87,6 @@ class IPAddress: public Printable { friend class DNSClient; }; -const IPAddress INADDR_NONE(0, 0, 0, 0); +extern const IPAddress INADDR_NONE; #endif