From 47d4f04321a1a43e381cd9853bd5635237f50196 Mon Sep 17 00:00:00 2001 From: Yuxuan Shui Date: Mon, 25 Dec 2017 22:17:26 -0500 Subject: [PATCH] Add musl libc definitions to: src_core_sys_posix_arpa_inet --- src/core/sys/posix/arpa/inet.d | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/core/sys/posix/arpa/inet.d b/src/core/sys/posix/arpa/inet.d index 04c95a7232..f4819f9b4e 100644 --- a/src/core/sys/posix/arpa/inet.d +++ b/src/core/sys/posix/arpa/inet.d @@ -247,6 +247,31 @@ else version( CRuntime_Bionic ) const(char)* inet_ntop(int, in void*, char*, size_t); int inet_pton(int, in char*, void*); } +else version( CRuntime_Musl ) +{ + alias uint16_t in_port_t; + alias uint32_t in_addr_t; + + struct in_addr + { + in_addr_t s_addr; + } + + enum INET_ADDRSTRLEN = 16; + + @trusted pure + { + uint32_t htonl(uint32_t); + uint16_t htons(uint16_t); + uint32_t ntohl(uint32_t); + uint16_t ntohs(uint16_t); + } + + in_addr_t inet_addr(in char*); + char* inet_ntoa(in_addr); + const(char)* inet_ntop(int, in void*, char*, socklen_t); + int inet_pton(int, in char*, void*); +} // // IPV6 (IP6)