mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-15 17:02:53 +08:00
fix socket PIKA_LWIP_ENABLE macro
This commit is contained in:
parent
1ceb015391
commit
67b56c9be4
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user