From e1b6b2219d2e5b44c50b9809a19321ee0d0c77db Mon Sep 17 00:00:00 2001 From: Gisle Vanem Date: Mon, 7 Dec 2015 14:27:29 -0500 Subject: lwip: Fix compatibility issues with later versions The name of the header guard in lwIP's has changed from '__LWIP_OPT_H__' to 'LWIP_HDR_OPT_H' (bug #35874 in May 2015). Other fixes: - In curl_setup.h, the problem with an old PSDK doesn't apply if lwIP is used. - In memdebug.h, the 'socket' should be undefined first due to lwIP's lwip_socket() macro. - In curl_addrinfo.c lwIP's getaddrinfo() + freeaddrinfo() macros need special handling because they were undef'ed in memdebug.h. - In select.c we can't use preprocessor conditionals inside select if MSVC and select is a macro, as it is with lwIP. http://curl.haxx.se/mail/lib-2015-12/0023.html http://curl.haxx.se/mail/lib-2015-12/0024.html --- lib/curl_addrinfo.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/curl_addrinfo.c') diff --git a/lib/curl_addrinfo.c b/lib/curl_addrinfo.c index 6627a6b96..17ee95858 100644 --- a/lib/curl_addrinfo.c +++ b/lib/curl_addrinfo.c @@ -521,7 +521,11 @@ void curl_dofreeaddrinfo(struct addrinfo *freethis, int line, const char *source) { +#ifdef USE_LWIPSOCK + lwip_freeaddrinfo(freethis); +#else (freeaddrinfo)(freethis); +#endif curl_memlog("ADDR %s:%d freeaddrinfo(%p)\n", source, line, (void *)freethis); } @@ -544,7 +548,11 @@ curl_dogetaddrinfo(const char *hostname, struct addrinfo **result, int line, const char *source) { +#ifdef USE_LWIPSOCK + int res=lwip_getaddrinfo(hostname, service, hints, result); +#else int res=(getaddrinfo)(hostname, service, hints, result); +#endif if(0 == res) /* success */ curl_memlog("ADDR %s:%d getaddrinfo() = %p\n", -- cgit v1.2.3