refactor: define _BSD_SOURCE in cc.h instead of gn file

define _BSD_SOURCE in cc.h instead of gn file

close: #I4J8OT

Signed-off-by: liujiandong <liujiandong1@huawei.com>
This commit is contained in:
YOUR_NAME 2021-11-22 15:27:00 +08:00
parent 4e0bf74f4a
commit 57208d6e14
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" module_name = "lwip"
kernel_module(module_name) { kernel_module(module_name) {
sources = LWIP_PORTING_FILES + LWIPNOAPPSFILES - [ "$LWIPDIR/api/sockets.c" ] sources = LWIP_PORTING_FILES + LWIPNOAPPSFILES - [ "$LWIPDIR/api/sockets.c" ]
defines = [ "_BSD_SOURCE=1" ]
include_dirs = [ "//utils/native/lite/include" ] include_dirs = [ "//utils/native/lite/include" ]
} }

View File

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

View File

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

View File

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

View File

@ -32,6 +32,7 @@
#ifndef _LWIP_PORTING_SOCKETS_H_ #ifndef _LWIP_PORTING_SOCKETS_H_
#define _LWIP_PORTING_SOCKETS_H_ #define _LWIP_PORTING_SOCKETS_H_
#include "lwip/arch.h"
#include <sys/socket.h> #include <sys/socket.h>
#include <poll.h> #include <poll.h>
#include <netinet/tcp.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; u8_t err = 0;
struct ifreq *ifr = (struct ifreq *)argp; struct ifreq *ifr = (struct ifreq *)argp;
bool is_ipv6 = 0; u8_t is_ipv6 = 0;
/* allow it only on IPv6 sockets... */ /* allow it only on IPv6 sockets... */
is_ipv6 = NETCONNTYPE_ISIPV6((unsigned int)(sock->conn->type)); is_ipv6 = NETCONNTYPE_ISIPV6((unsigned int)(sock->conn->type));