Skip to content

Commit 76faefd

Browse files
authored
Merge pull request #22 from an-tao/dev
Fix a compiling bug on Alpine Linux
2 parents 5ac102e + 8acb096 commit 76faefd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

trantor/net/InetAddress.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,14 @@ static const in_addr_t kInaddrLoopback = INADDR_LOOPBACK;
4545

4646
using namespace trantor;
4747

48+
/*
4849
#ifdef __linux__
4950
#if !(__GNUC_PREREQ(4, 6))
5051
#pragma GCC diagnostic ignored "-Winvalid-offsetof"
5152
#endif
5253
#endif
54+
*/
55+
5356
InetAddress::InetAddress(uint16_t port, bool loopbackOnly, bool ipv6)
5457
: _isIpV6(ipv6)
5558
{
@@ -192,7 +195,7 @@ const uint32_t *InetAddress::ip6NetEndian() const
192195
{
193196
//assert(family() == AF_INET6);
194197
#ifdef __linux__
195-
return _addr6.sin6_addr.__in6_u.__u6_addr32;
198+
return _addr6.sin6_addr.s6_addr32;
196199
#else
197200
return _addr6.sin6_addr.__u6_addr.__u6_addr32;
198201
#endif

0 commit comments

Comments
 (0)