!410 宏_BSD_SOURCE放在头文件中定义,其他模块使用lwip头文件时,可不用单独再定义

Merge pull request !410 from 刘建东/master
This commit is contained in:
openharmony_ci 2021-11-24 01:41:39 +00:00 committed by Gitee
commit 8310aba4ea
6 changed files with 8 additions and 2 deletions

View File

@ -34,7 +34,6 @@ module_switch = defined(LOSCFG_NET_LWIP_SACK)
module_name = "lwip"
kernel_module(module_name) {
sources = LWIP_PORTING_FILES + LWIPNOAPPSFILES - [ "$LWIPDIR/api/sockets.c" ]
defines = [ "_BSD_SOURCE=1" ]
include_dirs = [ "//utils/native/lite/include" ]
}

View File

@ -106,4 +106,8 @@ extern void LwipLogPrintf(const char *fmt, ...);
#define init_waitqueue_head(...)
#define poll_check_waiters(...)
#ifndef _BSD_SOURCE
#define _BSD_SOURCE 1
#endif
#endif /* _LWIP_PORTING_CC_H_ */

View File

@ -32,6 +32,7 @@
#ifndef _LWIP_PORTING_NETDB_H_
#define _LWIP_PORTING_NETDB_H_
#include "lwip/arch.h"
#include <netdb.h>
#include_next <lwip/netdb.h>

View File

@ -32,6 +32,7 @@
#ifndef _LWIP_PORTING_NETIF_H_
#define _LWIP_PORTING_NETIF_H_
#include "lwip/arch.h"
#include <net/if.h>
#include <netinet/ip.h>

View File

@ -32,6 +32,7 @@
#ifndef _LWIP_PORTING_SOCKETS_H_
#define _LWIP_PORTING_SOCKETS_H_
#include "lwip/arch.h"
#include <sys/socket.h>
#include <poll.h>
#include <netinet/tcp.h>

View File

@ -704,7 +704,7 @@ static u8_t lwip_ioctl_impl(const struct lwip_sock *sock, long cmd, void *argp)
{
u8_t err = 0;
struct ifreq *ifr = (struct ifreq *)argp;
bool is_ipv6 = 0;
u8_t is_ipv6 = 0;
/* allow it only on IPv6 sockets... */
is_ipv6 = NETCONNTYPE_ISIPV6((unsigned int)(sock->conn->type));