net/IPv[46]Address: add cast to void* to fix GCC9 build failure
Fixes: src/net/IPv4Address.hxx: In member function 'constexpr IPv4Address::operator SocketAddress() const': src/net/IPv4Address.hxx:171:24: error: a reinterpret_cast is not a constant expression 171 | return SocketAddress((const struct sockaddr *)&address, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/net/IPv6Address.hxx: In member function 'constexpr IPv6Address::operator SocketAddress() const': src/net/IPv6Address.hxx:138:24: error: a reinterpret_cast is not a constant expression 138 | return SocketAddress((const struct sockaddr *)&address, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Closes https://github.com/MusicPlayerDaemon/MPD/issues/522
This commit is contained in:
parent
511826763a
commit
37b54179d8
1
NEWS
1
NEWS
|
@ -1,4 +1,5 @@
|
||||||
ver 0.21.8 (not yet released)
|
ver 0.21.8 (not yet released)
|
||||||
|
* fix build failure with GCC 9
|
||||||
|
|
||||||
ver 0.21.7 (2019/04/03)
|
ver 0.21.7 (2019/04/03)
|
||||||
* input
|
* input
|
||||||
|
|
|
@ -168,7 +168,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr operator SocketAddress() const noexcept {
|
constexpr operator SocketAddress() const noexcept {
|
||||||
return SocketAddress((const struct sockaddr *)&address,
|
return SocketAddress((const struct sockaddr *)(const void *)&address,
|
||||||
sizeof(address));
|
sizeof(address));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -135,7 +135,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr operator SocketAddress() const noexcept {
|
constexpr operator SocketAddress() const noexcept {
|
||||||
return SocketAddress((const struct sockaddr *)&address,
|
return SocketAddress((const struct sockaddr *)(const void *)&address,
|
||||||
sizeof(address));
|
sizeof(address));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue