From: Ivan Grokhotkov Date: Mon, 10 Sep 2018 04:21:59 +0000 (+0800) Subject: lwip: add compatibility headers for sntp.h and esp_ping.h X-Git-Tag: v3.2-beta1~103^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f8750eb58db79e0a39acfe2acc1ac6631fe91c1a;p=esp-idf lwip: add compatibility headers for sntp.h and esp_ping.h Before LwIP was moved into a submodule, sntp and esp_ping were available as the following includes: #include "apps/sntp/sntp.h" #include "esp_ping.h" This commit makes header files available at the old location, and adds a deprecation warning for sntp.h. Closes https://github.com/espressif/esp-idf/issues/2392 --- diff --git a/components/esp32/esp_err_to_name.c b/components/esp32/esp_err_to_name.c index aee804b053..1044ebe058 100644 --- a/components/esp32/esp_err_to_name.c +++ b/components/esp32/esp_err_to_name.c @@ -4,8 +4,8 @@ #if __has_include("soc/soc.h") #include "soc/soc.h" #endif -#if __has_include("apps/ping/esp_ping.h") -#include "apps/ping/esp_ping.h" +#if __has_include("apps/esp_ping.h") +#include "apps/esp_ping.h" #endif #if __has_include("esp32/ulp.h") #include "esp32/ulp.h" @@ -399,7 +399,7 @@ static const esp_err_msg_t esp_err_msg_table[] = { # ifdef ESP_ERR_TCPIP_ADAPTER_DHCP_NOT_STOPPED ERR_TBL_IT(ESP_ERR_TCPIP_ADAPTER_DHCP_NOT_STOPPED), /* 20487 0x5007 */ # endif - // components/lwip/include/apps/ping/esp_ping.h + // components/lwip/include/apps/esp_ping.h # ifdef ESP_ERR_PING_BASE ERR_TBL_IT(ESP_ERR_PING_BASE), /* 24576 0x6000 */ # endif diff --git a/components/lwip/CMakeLists.txt b/components/lwip/CMakeLists.txt index 794d5bc6a4..29c8d9fb69 100644 --- a/components/lwip/CMakeLists.txt +++ b/components/lwip/CMakeLists.txt @@ -3,6 +3,7 @@ set(COMPONENT_ADD_INCLUDEDIRS lwip/src/include port/esp32/include port/esp32/include/arch + include_compat ) set(COMPONENT_SRCS "apps/dhcpserver/dhcpserver.c" diff --git a/components/lwip/apps/ping/esp_ping.c b/components/lwip/apps/ping/esp_ping.c index 43e405f240..cae4c866b1 100644 --- a/components/lwip/apps/ping/esp_ping.c +++ b/components/lwip/apps/ping/esp_ping.c @@ -13,7 +13,7 @@ // limitations under the License. #include -#include "ping/esp_ping.h" +#include "esp_ping.h" #include "lwip/ip_addr.h" diff --git a/components/lwip/apps/ping/ping.c b/components/lwip/apps/ping/ping.c index eb7e71c60e..64b005749d 100644 --- a/components/lwip/apps/ping/ping.c +++ b/components/lwip/apps/ping/ping.c @@ -58,7 +58,7 @@ #endif /* PING_USE_SOCKETS */ #ifdef ESP_PING -#include "ping/esp_ping.h" +#include "esp_ping.h" #include "lwip/ip_addr.h" #endif /** diff --git a/components/lwip/component.mk b/components/lwip/component.mk index e33ea7f368..684a5794d5 100644 --- a/components/lwip/component.mk +++ b/components/lwip/component.mk @@ -7,7 +7,8 @@ COMPONENT_ADD_INCLUDEDIRS := \ include/apps \ lwip/src/include \ port/esp32/include \ - port/esp32/include/arch + port/esp32/include/arch \ + include_compat COMPONENT_SRCDIRS := \ apps/dhcpserver \ diff --git a/components/lwip/include/apps/ping/esp_ping.h b/components/lwip/include/apps/esp_ping.h similarity index 100% rename from components/lwip/include/apps/ping/esp_ping.h rename to components/lwip/include/apps/esp_ping.h diff --git a/components/lwip/include_compat/apps/sntp/sntp.h b/components/lwip/include_compat/apps/sntp/sntp.h new file mode 100644 index 0000000000..3db0fba1eb --- /dev/null +++ b/components/lwip/include_compat/apps/sntp/sntp.h @@ -0,0 +1,3 @@ +#pragma once +#warning "This header file is deprecated, please include lwip/apps/sntp.h instead." +#include "lwip/apps/sntp.h"