diff --git a/src/net/SocketAddress.cxx b/src/net/SocketAddress.cxx index 20c7cf989..2695b1f7f 100644 --- a/src/net/SocketAddress.cxx +++ b/src/net/SocketAddress.cxx @@ -129,8 +129,6 @@ SocketAddress::GetPort() const noexcept } } -#ifdef __cpp_lib_span - static std::span GetSteadyPart(const struct sockaddr_in &address) noexcept { @@ -149,12 +147,8 @@ GetSteadyPart(const struct sockaddr_in6 &address) noexcept }; } -#endif // __cpp_lib_span - #endif // HAVE_TCP -#ifdef __cpp_lib_span - std::span SocketAddress::GetSteadyPart() const noexcept { @@ -179,5 +173,3 @@ SocketAddress::GetSteadyPart() const noexcept return {}; } } - -#endif diff --git a/src/net/SocketAddress.hxx b/src/net/SocketAddress.hxx index 184eb4714..4097b4a19 100644 --- a/src/net/SocketAddress.hxx +++ b/src/net/SocketAddress.hxx @@ -39,15 +39,12 @@ #endif #include +#include #if __cplusplus >= 202002 || (defined(__GNUC__) && __GNUC__ >= 10) #include #endif -#ifdef __cpp_lib_span -#include -#endif - #ifdef HAVE_UN #include #endif @@ -79,11 +76,9 @@ public: size_type _size) noexcept :address(_address), size(_size) {} -#ifdef __cpp_lib_span explicit SocketAddress(std::span src) noexcept :address((const struct sockaddr *)(const void *)src.data()), size(src.size()) {} -#endif static constexpr SocketAddress Null() noexcept { return nullptr; @@ -179,7 +174,6 @@ public: unsigned GetPort() const noexcept; #endif -#ifdef __cpp_lib_span operator std::span() const noexcept { const void *q = reinterpret_cast(address); return { @@ -197,7 +191,6 @@ public: */ [[gnu::pure]] std::span GetSteadyPart() const noexcept; -#endif [[gnu::pure]] bool operator==(const SocketAddress other) const noexcept;