summaryrefslogtreecommitdiff
path: root/lib/curl_addrinfo.c
diff options
context:
space:
mode:
authorGisle Vanem <gvanem@yahoo.no>2015-12-07 14:27:29 -0500
committerJay Satiro <raysatiro@yahoo.com>2015-12-07 14:27:55 -0500
commite1b6b2219d2e5b44c50b9809a19321ee0d0c77db (patch)
treeec78e53e1c801f1f34d85ecebb74a25f7600f35b /lib/curl_addrinfo.c
parentec26399bf9c2b3dc6c68eb847530bfd669598e47 (diff)
downloadcurl-e1b6b2219d2e5b44c50b9809a19321ee0d0c77db.tar.gz
lwip: Fix compatibility issues with later versions
The name of the header guard in lwIP's <lwip/opt.h> 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
Diffstat (limited to 'lib/curl_addrinfo.c')
-rw-r--r--lib/curl_addrinfo.c8
1 files changed, 8 insertions, 0 deletions
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",