From 97cd07007da3aba21fcc108b12845710ccfa998b Mon Sep 17 00:00:00 2001 From: "Michael (XIAO Xufeng)" Date: Wed, 16 Sep 2020 12:31:12 +0800 Subject: [PATCH 1/2] ci: define ESP_PLATFORM macro during public header check --- tools/ci/check_public_headers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ci/check_public_headers.py b/tools/ci/check_public_headers.py index af934acd9c..64acca32c4 100644 --- a/tools/ci/check_public_headers.py +++ b/tools/ci/check_public_headers.py @@ -195,7 +195,7 @@ class PublicHeaderChecker: raise HeaderFailedBuildError() def preprocess_one_header(self, header, num, ignore_sdkconfig_issue=False): - all_compilation_flags = ["-w", "-P", "-E", "-include", header, self.main_c] + self.include_dir_flags + all_compilation_flags = ["-w", "-P", "-E", "-DESP_PLATFORM", "-include", header, self.main_c] + self.include_dir_flags if not ignore_sdkconfig_issue: # just strip commnets to check for CONFIG_... macros rc, out, err = exec_cmd([self.gcc, "-fpreprocessed", "-dD", "-P", "-E", header] + self.include_dir_flags) From 440b5f6e7b90dc26c3b917f7b9773842d00ff9ce Mon Sep 17 00:00:00 2001 From: mathiasbredholt Date: Thu, 24 Sep 2020 09:28:51 +0200 Subject: [PATCH 2/2] lwip: Changed to C linkage for fixing bug when using mixed C/C++ code Merges https://github.com/espressif/esp-idf/pull/5900 --- components/lwip/port/esp32/include/netdb.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/components/lwip/port/esp32/include/netdb.h b/components/lwip/port/esp32/include/netdb.h index 363154f688..7f5d67a465 100644 --- a/components/lwip/port/esp32/include/netdb.h +++ b/components/lwip/port/esp32/include/netdb.h @@ -32,9 +32,17 @@ #include "lwip/netdb.h" +#ifdef __cplusplus +extern "C" { +#endif + #ifdef ESP_PLATFORM int getnameinfo(const struct sockaddr *addr, socklen_t addrlen, char *host, socklen_t hostlen, char *serv, socklen_t servlen, int flags); #endif + +#ifdef __cplusplus +} +#endif