summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTangyuxin <[email protected]>2022-05-30 18:01:18 +0800
committerGitHub <[email protected]>2022-05-30 18:01:18 +0800
commit577d619d4c7d3cb4db1e3741f4657dd527eca371 (patch)
tree1b9982e3b3055e0e4ad1ce5096da4a34d4e490d6
parente8d775f888f14e4fe3cc7bd57740fda0caaf4ece (diff)
[net][lwip] Support windows simulator (#5993)
-rw-r--r--components/net/lwip/port/arch/bpstruct.h2
-rw-r--r--components/net/lwip/port/arch/cc.h1
-rw-r--r--components/net/lwip/port/arch/epstruct.h2
-rw-r--r--components/net/lwip/port/ethernetif.c6
4 files changed, 6 insertions, 5 deletions
diff --git a/components/net/lwip/port/arch/bpstruct.h b/components/net/lwip/port/arch/bpstruct.h
index 9ca70cff7f..dfc913dc14 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 e79ead4027..c8e395db87 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 a7ed4f4a26..cc4b5c963b 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 f5c2417eb6..55ea81a867 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;
}