[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] MSVC fix for api_msg.c
From: |
Gisle Vanem |
Subject: |
[lwip-devel] MSVC fix for api_msg.c |
Date: |
Mon, 7 Sep 2015 21:18:02 +0200 |
User-agent: |
Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0 SeaMonkey/2.35 |
The recent change of:
2015-09-03: Simon Goldschmidt
* opt.h, dns.h/.c: DNS/IPv6: added support for AAAA records
breaks the inferior C-preprocessor of MSVC in src/api/api_msg.c:
API_EXPR_DEREF(msg->err) = dns_gethostbyname_addrtype(msg->name,
API_EXPR_REF(msg->addr),
lwip_netconn_do_dns_found, msg
#if LWIP_IPV4 && LWIP_IPV6
, msg->dns_addrtype
#endif /* LWIP_IPV4 && LWIP_IPV6 */
);
The "meat" of the dns_gethostbyname_addrtype() macro MUST be written w/o
any '#if X'. Attached a diff that works for me. But it still looks butt-ugly
with a reference + dereference in the same statement. Can this
dns_gethostbyname_addrtype() macro in dns.h be dropped? And use a
function always?
There also is a typo in api.h:
--- a/src/include/lwip/api.h 2015-09-07 20:46:41
+++ b/src/include/lwip/api.h 2015-09-07 20:53:39
@@ -297,7 +297,7 @@
#define netconn_gethostbyname(name, addr)
netconn_gethostbyname_addrtype(name, addr, NETCONN_DNS_DEFAULT)
#else /* LWIP_IPV4 && LWIP_IPV6 */
err_t netconn_gethostbyname(const char *name, ip_addr_t *addr);
-#define netconn_gethostbyname_addrtype(name, addr, dns_addrtype
netconn_gethostbyname(name, addr)
+#define netconn_gethostbyname_addrtype(name, addr, dns_addrtype)
netconn_gethostbyname(name, addr)
#endif /* LWIP_IPV4 && LWIP_IPV6 */
#endif /* LWIP_DNS */
--------------------
PS. I tried to add this to the bug-tracker, but failed to create
an account. Go figure!
--
--gv
diff-1.txt
Description: Text document
- [lwip-devel] MSVC fix for api_msg.c,
Gisle Vanem <=