fix socket PIKA_LWIP_ENABLE macro

This commit is contained in:
dreamcmi 2022-12-21 13:04:06 +08:00
parent 1ceb015391
commit 67b56c9be4
2 changed files with 6 additions and 6 deletions

View File

@ -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);

View File

@ -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);