diff --git a/package/socket/PikaPlatform_socket.c b/package/socket/PikaPlatform_socket.c index fd5f0d5d3511ce3e661b3d083e2da1d457e10293..1249201622644b30c01027c2abf9e35c5ec999f5 100644 --- a/package/socket/PikaPlatform_socket.c +++ b/package/socket/PikaPlatform_socket.c @@ -99,9 +99,9 @@ PIKA_WEAK struct hostent* pika_platform_gethostbyname(const char* __name) { } /* inet_ntoa */ -PIKA_WEAK char* pika_platform_inet_ntoa(struct in_addr in_addr_val) { +PIKA_WEAK char* pika_platform_inet_ntoa(struct in_addr __addr) { #if defined(__linux__) || defined(_WIN32) || PIKA_LWIP_ENABLE - return inet_ntoa(in_addr_val); + return inet_ntoa(__addr); #else WEAK_FUNCTION_NEED_OVERRIDE_ERROR(); #endif @@ -203,8 +203,10 @@ PIKA_WEAK int pika_platform_close(int __fd) { } PIKA_WEAK int pika_platform_write(int __fd, const void* __buf, size_t __nbyte) { -#if defined(__linux__) || defined(_WIN32) || PIKA_LWIP_ENABLE +#if defined(__linux__) || PIKA_LWIP_ENABLE return write(__fd, __buf, __nbyte); +#elif defined(_WIN32) + return send(__fd, __buf, __nbyte, 0); #else WEAK_FUNCTION_NEED_OVERRIDE_ERROR(); #endif diff --git a/package/socket/PikaPlatform_socket.h b/package/socket/PikaPlatform_socket.h index cf8e1e06423da0d8ac2c39ea835c6cdd22666f2d..e3395c45e8286454dbd18dd959012f30b61ac3a2 100644 --- a/package/socket/PikaPlatform_socket.h +++ b/package/socket/PikaPlatform_socket.h @@ -15,7 +15,6 @@ #include #include #include -#include #define O_NONBLOCK 0x0004 /* non blocking I/O, from BSD */ #define F_GETFL 3 @@ -63,7 +62,7 @@ int pika_platform_setsockopt(int __fd, const void* __optval, socklen_t __optlen); int pika_platform_htons(int __hostshort); -char* pika_platform_inet_ntoa(struct in_addr in_addr_val); +char* pika_platform_inet_ntoa(struct in_addr __addr); struct hostent* pika_platform_gethostbyname(const char* __name); /* os file API */