From 67b56c9be40b6c1682e1834b1fb8fe17a3366e00 Mon Sep 17 00:00:00 2001 From: dreamcmi <1912544842@qq.com> Date: Wed, 21 Dec 2022 13:04:06 +0800 Subject: [PATCH] fix socket PIKA_LWIP_ENABLE macro --- package/socket/PikaPlatform_socket.c | 6 +++--- .../pikascript/pikascript-lib/socket/PikaPlatform_socket.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package/socket/PikaPlatform_socket.c b/package/socket/PikaPlatform_socket.c index 753f5aedb..482d7a74b 100644 --- a/package/socket/PikaPlatform_socket.c +++ b/package/socket/PikaPlatform_socket.c @@ -71,7 +71,7 @@ PIKA_WEAK int __platform_recv(int __fd, void* __buf, size_t __n, int __flags) { /* gethostname */ PIKA_WEAK int __platform_gethostname(char* __name, size_t __len) { -#if defined(__linux__) +#if defined(__linux__) || PIKA_LWIP_ENABLE return gethostname(__name, __len); #else WEAK_FUNCTION_NEED_OVERRIDE_ERROR(); @@ -110,7 +110,7 @@ PIKA_WEAK int __platform_setsockopt(int __fd, } PIKA_WEAK int __platform_fcntl(int fd, int cmd, long arg) { -#ifdef __linux__ +#if defined(__linux__) || PIKA_LWIP_ENABLE return fcntl(fd, cmd, arg); #else WEAK_FUNCTION_NEED_OVERRIDE_ERROR(); @@ -119,7 +119,7 @@ PIKA_WEAK int __platform_fcntl(int fd, int cmd, long arg) { /* os file API */ PIKA_WEAK int __platform_close(int __fd) { -#ifdef __linux__ +#if defined(__linux__) || PIKA_LWIP_ENABLE return close(__fd); #elif PIKA_FREERTOS_ENABLE return closesocket(__fd); diff --git a/port/linux/package/pikascript/pikascript-lib/socket/PikaPlatform_socket.c b/port/linux/package/pikascript/pikascript-lib/socket/PikaPlatform_socket.c index 753f5aedb..482d7a74b 100644 --- a/port/linux/package/pikascript/pikascript-lib/socket/PikaPlatform_socket.c +++ b/port/linux/package/pikascript/pikascript-lib/socket/PikaPlatform_socket.c @@ -71,7 +71,7 @@ PIKA_WEAK int __platform_recv(int __fd, void* __buf, size_t __n, int __flags) { /* gethostname */ PIKA_WEAK int __platform_gethostname(char* __name, size_t __len) { -#if defined(__linux__) +#if defined(__linux__) || PIKA_LWIP_ENABLE return gethostname(__name, __len); #else WEAK_FUNCTION_NEED_OVERRIDE_ERROR(); @@ -110,7 +110,7 @@ PIKA_WEAK int __platform_setsockopt(int __fd, } PIKA_WEAK int __platform_fcntl(int fd, int cmd, long arg) { -#ifdef __linux__ +#if defined(__linux__) || PIKA_LWIP_ENABLE return fcntl(fd, cmd, arg); #else WEAK_FUNCTION_NEED_OVERRIDE_ERROR(); @@ -119,7 +119,7 @@ PIKA_WEAK int __platform_fcntl(int fd, int cmd, long arg) { /* os file API */ PIKA_WEAK int __platform_close(int __fd) { -#ifdef __linux__ +#if defined(__linux__) || PIKA_LWIP_ENABLE return close(__fd); #elif PIKA_FREERTOS_ENABLE return closesocket(__fd);