提交 f8cad530 编写于 作者: O openharmony_ci 提交者: Gitee

!377 修改inet_addr等宏为函数,外层调用可不包含lwip头文件

Merge pull request !377 from 刘建东/master
......@@ -43,9 +43,6 @@
(ip4_addr_set_u32(target_ipaddr, (source_inaddr)->s_addr))
/* directly map this to the lwip internal functions */
#define inet_addr(cp) ipaddr_addr(cp)
#define inet_aton(cp, addr) ip4addr_aton(cp, (ip4_addr_t*)addr)
#define inet_ntoa(addr) ip4addr_ntoa((const ip4_addr_t*)&(addr))
#define inet_ntoa_r(addr, buf, buflen) ip4addr_ntoa_r((const ip4_addr_t*)&(addr), buf, buflen)
#endif /* LWIP_IPV4 */
#if LWIP_IPV6
......
......@@ -161,6 +161,27 @@ int inet_pton(int af, const char *src, void *dst)
return lwip_inet_pton(af, src, dst);
}
#ifndef LWIP_INET_ADDR_FUNC
in_addr_t inet_addr(const char *cp)
{
return ipaddr_addr(cp);
}
#endif
#ifndef LWIP_INET_NTOA_FUNC
char *inet_ntoa(struct in_addr addr)
{
return ip4addr_ntoa((const ip4_addr_t*)&(addr));
}
#endif
#ifndef LWIP_INET_ATON_FUNC
int inet_aton(const char *cp, struct in_addr *addr)
{
return ip4addr_aton(cp, (ip4_addr_t*)addr);
}
#endif
int ioctlsocket(int s, long cmd, void *argp)
{
return lwip_ioctl(s, cmd, argp);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册