diff --git a/components/net/lwip/port/arch/bpstruct.h b/components/net/lwip/port/arch/bpstruct.h index 9ca70cff7f8e353aa7947c0101e3214714cf17ad..dfc913dc14ff93fb3240cb6d1d9f5e064af70695 100644 --- a/components/net/lwip/port/arch/bpstruct.h +++ b/components/net/lwip/port/arch/bpstruct.h @@ -8,6 +8,6 @@ * 2022-02-20 Meco Man add RT-Thread copyright */ -#if defined(__ICCARM__) +#if defined(__ICCARM__) || defined(_WIN32) #pragma pack(1) #endif diff --git a/components/net/lwip/port/arch/cc.h b/components/net/lwip/port/arch/cc.h index e79ead4027f88f1a18b118a4a7ff3e3ac5e3ff62..c8e395db87a2dc62c3e24300feeb1ed742c0714f 100644 --- a/components/net/lwip/port/arch/cc.h +++ b/components/net/lwip/port/arch/cc.h @@ -100,6 +100,7 @@ typedef uintptr_t mem_ptr_t; #define PACK_STRUCT_STRUCT #define PACK_STRUCT_BEGIN #define PACK_STRUCT_END +#define PACK_STRUCT_USE_INCLUDES #endif void sys_arch_assert(const char* file, int line); diff --git a/components/net/lwip/port/arch/epstruct.h b/components/net/lwip/port/arch/epstruct.h index a7ed4f4a26684e84d328862fccbeed04bc7a61f5..cc4b5c963b7c083020d2d155036a2d01bcecb23a 100644 --- a/components/net/lwip/port/arch/epstruct.h +++ b/components/net/lwip/port/arch/epstruct.h @@ -8,6 +8,6 @@ * 2022-02-20 Meco Man add RT-Thread copyright */ -#if defined(__ICCARM__) +#if defined(__ICCARM__) || defined(_WIN32) #pragma pack() #endif diff --git a/components/net/lwip/port/ethernetif.c b/components/net/lwip/port/ethernetif.c index f5c2417eb60a6f9db4f904cb95b4d7fb9b463487..55ea81a8674ed3b62039fedba257d5aaa68439db 100644 --- a/components/net/lwip/port/ethernetif.c +++ b/components/net/lwip/port/ethernetif.c @@ -469,13 +469,13 @@ static err_t eth_netif_device_init(struct netif *netif) rt_device_t device; #ifdef RT_USING_NETDEV - /* network interface device register */ - netdev_add(netif); + /* network interface device register */ + netdev_add(netif); #endif /* RT_USING_NETDEV */ /* get device object */ device = (rt_device_t) ethif; - if (rt_device_init(device) != RT_EOK) + if (rt_device_open(device, RT_DEVICE_FLAG_RDWR) != RT_EOK) { return ERR_IF; }